Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #356 from multinet-app/fix_specify_csv
Browse files Browse the repository at this point in the history
Fix key specifier bug in csv uploader
  • Loading branch information
jjnesbitt committed Mar 27, 2020
2 parents d3a70b9 + 1416594 commit 6658e79
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion multinet/uploaders/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@ def upload(
# Perform validation.
validate_csv(rows, key, overwrite)

if key != "_key" and overwrite:
# Once we reach here, we know that the specified key field must be present,
# and either:
# key == "_key" # noqa: E800
# or key != "_key" and the "_key" field is not present
# or key != "_key" and "_key" is present, but overwrite = True
if key != "_key":
rows = set_table_key(rows, key)

# Set the collection, paying attention to whether the data contains
Expand Down

0 comments on commit 6658e79

Please sign in to comment.