Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using unused statuses for cps data-indices file upload #129

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion deepsearch/cps/cli/data_indices_typer.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,20 @@ def upload_files(
raise typer.Abort()

coords = ElasticProjectDataCollectionSource(proj_key=proj_key, index_key=index_key)
utils.upload_files(
statuses = utils.upload_files(
api=api,
coords=coords,
url=urls,
local_file=local_file,
s3_coordinates=cos_coordinates,
)

if all([status == "SUCCESS" for status in statuses]):
typer.echo("File upload completed successfully")
else:
# TODO
typer.echo("Some files did not upload successfully")


@app.command(
name="add-attachment", help="Add attachment to a index item", no_args_is_help=True
Expand Down
6 changes: 3 additions & 3 deletions deepsearch/cps/data_indices/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def process_url_input(
)
print(success_message)

return
return statuses


def process_local_file(
Expand Down Expand Up @@ -160,7 +160,7 @@ def process_local_file(
)
print(success_message)
cleanup(root_dir=root_dir)
return
return statuses


def process_external_cos(
Expand Down Expand Up @@ -197,4 +197,4 @@ def process_external_cos(
api=api, cps_proj_key=coords.proj_key, task_ids=task_ids
)
print(success_message)
return
return statuses