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 #354 from multinet-app/no-subsequent-upload
Browse files Browse the repository at this point in the history
Disallow uploading to a table that already exists
  • Loading branch information
waxlamp committed Mar 26, 2020
2 parents e3c4e71 + a193c5b commit 6f087ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions multinet/uploaders/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from dataclasses import dataclass

from multinet import db, util
from multinet.errors import ValidationFailed
from multinet.errors import AlreadyExists, ValidationFailed
from multinet.util import decode_data
from multinet.validation import ValidationFailure, DuplicateKey, UnsupportedTable

Expand Down Expand Up @@ -149,7 +149,7 @@ def upload(
# _from/_to fields.
space = db.get_workspace_db(workspace)
if space.has_collection(table):
coll = space.collection(table)
raise AlreadyExists("table", table)
else:
fieldnames = rows[0].keys()
edges = "_from" in fieldnames and "_to" in fieldnames
Expand Down

0 comments on commit 6f087ec

Please sign in to comment.