diff --git a/multinet/uploaders/csv.py b/multinet/uploaders/csv.py index 00fe78c4..3dc50895 100644 --- a/multinet/uploaders/csv.py +++ b/multinet/uploaders/csv.py @@ -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