cdm_data_loaders.pipelines.jsonlines.extract_jsonschema_validate_pipeline ¶
Load JSONL records validated against an external JSON Schema registry.
The module selected by entity_schemas must define ENTITY_SCHEMAS:
a mapping of table names to JSON Schema dictionaries, each declaring $schema.
Each validated JSON Schema is dereferenced and converted to a pyarrow.Schema
via JSONSchemaToPyArrow. Files are read from one input subdirectory per
table. Valid records are coerced to the target pyarrow.Schema and buffered
into pyarrow.Table pages via DictBuffer; parsing and validation
failures go to _rejected with table_name, source_file, line_no, raw_record,
and error_detail. Format checks are enabled.
build_entity_resource ¶
build_entity_resource(
table_name: str,
schema: ValidatedSchema,
settings: JsonlJsonschemaIngestSettings,
) -> DltResource
Read plain or gzip JSONL files for one entity and route validated pages.
A missing entity directory produces no rows. Validated records are coerced
to the target PyArrow schema(s) and buffered into pyarrow.Table pages via
DictBuffer. Nested values are preserved rather than normalized into
child tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table_name
|
str
|
table name |
required |
schema
|
ValidatedSchema
|
validated JSON Schema for the table |
required |
settings
|
JsonlJsonschemaIngestSettings
|
pipeline configuration |
required |
Returns:
| Type | Description |
|---|---|
DltResource
|
resource yielding validated and rejected records for this entity |
Source code in src/cdm_data_loaders/pipelines/jsonlines/extract_jsonschema_validate_pipeline.py
run_jsonlines_pipeline ¶
Load requested tables using the validated registry and precomputed PyArrow schemas.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings
|
JsonlJsonschemaIngestSettings
|
pipeline configuration |
required |
Returns:
| Type | Description |
|---|---|
LoadInfo | None
|
load information for the pipeline |