Skip to content

Commit

Permalink
Skip .jsonld files if a .json file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Nov 9, 2023
1 parent f8438c0 commit 66e6a11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ogc/na/ingest_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def find_contexts(filename: Path | str,
filename.parent / '_json-context.yml',
filename.parent / '_json-context.yaml',
):
if context_path.is_file():
if context_path.is_file() and not (filename.suffix == '.jsonld' and filename.with_suffix('.json').is_file()):
logger.info(f'Autodetected context {context_path} for file {filename}')
return [context_path]

Expand Down Expand Up @@ -723,7 +723,7 @@ def process(input_files: str | Path | Sequence[str | Path],
transform_args=transform_args,
))
except MissingContextException as e:
if skip_on_missing_context:
if skip_on_missing_context or batch:
logger.warning("Error processing JSON/JSON-LD file, skipping: %s", getattr(e, 'msg', str(e)))
else:
raise
Expand Down

0 comments on commit 66e6a11

Please sign in to comment.