Skip to content

Commit

Permalink
Merge pull request #45 from usegalaxy-eu/noactionfix
Browse files Browse the repository at this point in the history
Handling tables that have no actions in the status column
  • Loading branch information
bgruening authored Oct 26, 2021
2 parents d471f9f + 5af2584 commit 42ab56c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ena_upload/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.2"
__version__ = "0.4.3"
7 changes: 5 additions & 2 deletions ena_upload/ena_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def extract_targets(action, schema_dataframe):

for schema, dataframe in schema_dataframe.items():
filtered = dataframe.query(f'status=="{action}"')
# ? add a function to control empty filtered, return error
schema_targets[schema] = filtered
if not filtered.empty:
schema_targets[schema] = filtered

return schema_targets

Expand Down Expand Up @@ -711,6 +711,9 @@ def main():
# these rows are the targets for submission
schema_targets = extract_targets(action, schema_dataframe)

if not schema_targets:
sys.exit(f"There is no table submitted having at least one row with {action} as action in the status column.")

if action == 'ADD':
# when adding run object
# update schema_targets wit md5 hash
Expand Down

0 comments on commit 42ab56c

Please sign in to comment.