Skip to content

Commit

Permalink
Support empty data repositories
Browse files Browse the repository at this point in the history
By accident, newly created data repositories didn鈥檛 work with the
updater. The reason is that the updater checked the data schema version
but failed, because no meta.tsv file (which contains the data schema
version) was present.

This adds a check that, if the meta.tsv file is not yet present, simply
succeeds with the update, through which the data repository is populated
with an up-to-date schema anyway.
  • Loading branch information
pluehne committed Apr 23, 2018
1 parent 9366cee commit 7312292
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion updater/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ def checkSchemaVersion(dataDirectory):
schemaVersionLocal = 0

try:
with open(os.path.join(dataDirectory, "meta.tsv"), "r") as tsvFile:
metaFilePath = os.path.join(dataDirectory, "meta.tsv")

# If no meta.tsv has been created yet, no schema compatibility check is necessary
if not os.path.exists(metaFilePath):
return

with open(metaFilePath, "r") as tsvFile:
tsvReader = csv.reader(tsvFile, delimiter = "\t")

for row in tsvReader:
Expand Down

0 comments on commit 7312292

Please sign in to comment.