Skip to content

Commit

Permalink
Add debugging info for transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed May 10, 2023
1 parent 7259365 commit cc8e7eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ogc/na/ingest_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,11 @@ def uplift_json(data: dict | list, context: dict,
# Allow for transform lists to do sequential transformations
if isinstance(transform, str):
transform = (transform,)
for t in transform:
data_graph = json.loads(jq.compile(t).input(data_graph).text())
for i, t in enumerate(transform):
tranformed_txt = jq.compile(t).input(data_graph).text()
if logger.isEnabledFor(logging.DEBUG):
logger.debug('After transform %d:\n%s', i + 1, tranformed_txt)
data_graph = json.loads(tranformed_txt)

# Add types
types = context.get('types', {})
Expand Down

0 comments on commit cc8e7eb

Please sign in to comment.