henge 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: henge
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Storage and retrieval of object-derived, decomposable recursive unique identifiers.
5
5
  Home-page: https://databio.org
6
6
  Author: Nathan Sheffield
@@ -0,0 +1 @@
1
+ __version__ = "0.2.1"
@@ -142,7 +142,11 @@ class Henge(object):
142
142
  :param bool raw: Return the value as a raw, henge-delimited string, instead
143
143
  of processing into a mapping. Default: False.
144
144
  """
145
- item_type = self.database[druid + ITEM_TYPE]
145
+ try:
146
+ item_type = self.database[druid + ITEM_TYPE]
147
+ except KeyError:
148
+ raise NotFoundException(druid)
149
+
146
150
  digested_string = self.lookup(druid, item_type)
147
151
  reconstructed_item = json.loads(digested_string)
148
152
 
@@ -476,11 +480,14 @@ def split_schema(schema, name=None):
476
480
  schema_copy["properties"][p]["henge_class"] = hclass
477
481
  if schema_copy["properties"][p]["type"] in ["array"]:
478
482
  # recursive_properties.append(p)
479
- schema_copy["properties"][p] = {"type": "string"}
483
+ if schema_copy["properties"][p]["items"]["type"] == "integer":
484
+ schema_copy["properties"][p] = {"type": "string"}
485
+ else:
486
+ schema_copy["properties"][p] = {"type": "string"}
480
487
  if hclass:
481
488
  schema_copy["properties"][p]["henge_class"] = hclass
482
489
  else:
483
- schema_copy["properties"][p]["henge_class"] = "array"
490
+ schema_copy["properties"][p]["henge_class"] = "strarray"
484
491
  # schema_copy['properties'][p]['type'] = "string"
485
492
  # del schema_copy['properties']
486
493
  _LOGGER.debug(
@@ -503,7 +510,8 @@ def split_schema(schema, name=None):
503
510
  _LOGGER.debug("adding " + str(schema["henge_class"]))
504
511
  henge_class = schema_copy["henge_class"]
505
512
  # del schema_copy['henge_class']
506
- schema_copy["items"] = {"type": "string"}
513
+ if schema_copy["items"]["type"] != "integer":
514
+ schema_copy["items"] = {"type": "string"}
507
515
  if "recursive" in schema_copy and schema_copy["recursive"]:
508
516
  schema_copy["items"]["recursive"] = True
509
517
  if "henge_class" in schema["items"]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: henge
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Storage and retrieval of object-derived, decomposable recursive unique identifiers.
5
5
  Home-page: https://databio.org
6
6
  Author: Nathan Sheffield
@@ -1 +0,0 @@
1
- __version__ = "0.2.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes