Skip to content

Commit 42ab56c

Browse files
authored
Merge pull request #45 from usegalaxy-eu/noactionfix
Handling tables that have no actions in the status column
2 parents d471f9f + 5af2584 commit 42ab56c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ena_upload/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.4.2"
1+
__version__ = "0.4.3"

ena_upload/ena_upload.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def extract_targets(action, schema_dataframe):
7979

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

8585
return schema_targets
8686

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

714+
if not schema_targets:
715+
sys.exit(f"There is no table submitted having at least one row with {action} as action in the status column.")
716+
714717
if action == 'ADD':
715718
# when adding run object
716719
# update schema_targets wit md5 hash

0 commit comments

Comments
 (0)