Skip to content

Commit

Permalink
process.py: Handle directory based schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed (ODSC) committed Sep 25, 2024
1 parent 58e4fbb commit 0a0cee7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cove_bods/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from libcovebods.config import LibCoveBODSConfig
from libcovebods.jsonschemavalidate import JSONSchemaValidator
from libcovebods.additionalfields import AdditionalFields
from libcovebods.schema_dir import schema_registry
import libcovebods.run_tasks
import libcovebods.data_reader
from typing import List
Expand Down Expand Up @@ -298,13 +299,18 @@ def process(self, process_data: dict) -> dict:

os.makedirs(self.output_dir, exist_ok=True)

if os.path.isdir(process_data['schema'].pkg_schema_url):
schema = schema_registry(process_data['schema'].pkg_schema_url).contents("urn:statement")
else:
schema = process_data['schema'].pkg_schema_url

flatten_kwargs = {
"output_name": self.output_dir,
"root_list_path": "there-is-no-root-list-path",
"root_id": "statementID",
"id_name": "statementID",
"root_is_list": True,
"schema": process_data['schema'].pkg_schema_url,
"schema": schema,
}

try:
Expand Down

0 comments on commit 0a0cee7

Please sign in to comment.