Skip to content

Commit

Permalink
fix: Fixed issue where config was not generating properly due to CXG …
Browse files Browse the repository at this point in the history
…version upgrade (#492)

* fix with version parsing

* black

Co-authored-by: atarashansky <[email protected]>
  • Loading branch information
atarashansky and atarashansky authored Oct 7, 2022
1 parent 42e4222 commit e0500d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/dataset/cxg_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from server.compute import diffexp_cxg
from server.dataset.cxg_util import pack_selector_from_mask
from server.dataset.dataset import Dataset
from packaging import version


class CxgDataset(Dataset):
Expand Down Expand Up @@ -178,12 +179,11 @@ def _validate_and_initialize(self):
# version >0
gmd = self.open_array("cxg_group_metadata")
cxg_version = gmd.meta["cxg_version"]
# version 0.1 used a malformed/shorthand semver string.
if cxg_version == "0.1" or cxg_version == "0.2.0":
if version.parse(cxg_version) >= version.parse("0.1.0"):
cxg_properties = json.loads(gmd.meta["cxg_properties"])
title = cxg_properties.get("title", None)
about = cxg_properties.get("about", None)
if cxg_version == "0.2.0":
if version.parse(cxg_version) >= version.parse("0.2.0"):
corpora_props = json.loads(gmd.meta["corpora"]) if "corpora" in gmd.meta else None
else:
# version 0
Expand Down

0 comments on commit e0500d7

Please sign in to comment.