cdm_data_loaders.pipelines.jsonlines.settings ¶
Setting for the JSONL validate-and-load pipeline for the KBase CTS.
JsonlJsonschemaError ¶
Bases: RuntimeError
Base error raised when an ENTITY_SCHEMAS registry or entity JSON Schema is invalid or cannot convert to PyArrow.
Source code in src/cdm_data_loaders/pipelines/jsonlines/settings.py
InvalidEntitySchemasRegistryError ¶
Bases: JsonlJsonschemaError
The entity_schemas module must define a non-empty ENTITY_SCHEMAS dictionary and cannot use the reserved _rejected table name.
Source code in src/cdm_data_loaders/pipelines/jsonlines/settings.py
UnsupportedJsonlSchemaDialectError ¶
Bases: JsonlJsonschemaError
Every entity JSON Schema must declare a supported $schema draft URI (Draft 4, 6, 7, 2019-09, 2020-12, or KBase xsv_config).
Source code in src/cdm_data_loaders/pipelines/jsonlines/settings.py
InvalidJsonlEntitySchemaError ¶
Bases: JsonlJsonschemaError
Every entity JSON Schema must be a valid schema document under its declared $schema metaschema.
Source code in src/cdm_data_loaders/pipelines/jsonlines/settings.py
UnresolvableJsonlSchemaRefError ¶
Bases: JsonlJsonschemaError
All $ref pointers and allOf branches in an entity JSON Schema must resolve without cycles before PyArrow conversion.
Source code in src/cdm_data_loaders/pipelines/jsonlines/settings.py
UnsupportedJsonlArrowSchemaError ¶
Bases: JsonlJsonschemaError
Each non-transformed, non-overridden entity JSON Schema must have type: "object" with at least one property and only supported PyArrow column constructs.
Source code in src/cdm_data_loaders/pipelines/jsonlines/settings.py
JsonlIngestSettings ¶
Bases: FileFormatIngestSettings
Settings for the JSONL ingest pipeline.
Source code in src/cdm_data_loaders/pipelines/jsonlines/settings.py
JsonlExtractSettings ¶
Bases: JsonlIngestSettings, TransformSettingsMixin
Settings for the JSONL extraction-only pipeline.
Source code in src/cdm_data_loaders/pipelines/jsonlines/settings.py
JsonlPydanticIngestSettings ¶
Bases: JsonlIngestSettings, TransformSettingsMixin
Pipeline settings for JSONL pipeline that uses Pydantic for validation.
Source code in src/cdm_data_loaders/pipelines/jsonlines/settings.py
JsonlJsonschemaIngestSettings ¶
Bases: JsonlIngestSettings, TransformSettingsMixin
Pipeline settings for JSONL ingestion with JSON Schema validation.
Source code in src/cdm_data_loaders/pipelines/jsonlines/settings.py
NcbiDatasetsSettings ¶
Bases: JsonlJsonschemaIngestSettings
Pipeline settings for NCBI Datasets JSONL ingestion (annotation_report and dataset_report).
Source code in src/cdm_data_loaders/pipelines/jsonlines/settings.py
build_output_schema_registry ¶
build_output_schema_registry(
validation_schema_registry: (
SchemaRegistry | ModelRegistry
),
*,
table_transforms: TransformRegistry | None = None,
output_schemas: ArrowSchemaRegistry | None = None
) -> ArrowSchemaRegistry | None
Convert all entity JSON Schemas or Pydantic models to PyArrow schemas up front.
Conserves all entries in output_schemas and skips automatic
input-schema -> PyArrow conversion for any entity table whose PyArrow schema
is overridden by output_schemas or that has a configured
table_transforms entry. Collects any dereferencing or conversion errors
across all remaining tables and raises a single RuntimeError listing
every failing table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
validation_schema_registry
|
SchemaRegistry | ModelRegistry
|
schema or model registry of table name to validated JSON Schema or Pydantic model |
required |
table_transforms
|
TransformRegistry | None
|
optional registry of entity table name to |
None
|
output_schemas
|
ArrowSchemaRegistry | None
|
optional PyArrow schema registry |
None
|
Returns:
| Type | Description |
|---|---|
ArrowSchemaRegistry | None
|
PyArrow schema registry combining |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
if one or more schemas cannot be converted to PyArrow schemas |