Skip to content

cdm_data_loaders.pipelines.uniprot_kb_cdm

DLT pipeline to import UniProt data into KBase CDM tables via XML-to-PyArrow.

UniProtSettings

Bases: UniProtXmlToPyArrowSettings

Configuration for running the UniProt KB CDM XML-to-PyArrow import pipeline.

Source code in src/cdm_data_loaders/pipelines/uniprot_kb_cdm.py
class UniProtSettings(UniProtXmlToPyArrowSettings):
    """Configuration for running the UniProt KB CDM XML-to-PyArrow import pipeline."""

    model_config: SettingsConfigDict = default_settings_with_shortcuts(
        cli_prog_name=PIPELINE_NAME,
        cli_shortcuts=XML_CLI_SHORTCUTS,
    )

    dataset_name: ClassVar[str] = PIPELINE_NAME
    transforms_module: ClassVar[str | None] = None
    output_schemas_module: ClassVar[str | None] = None

    log_interval: Annotated[
        LogInterval,
        Field(
            default=UNIPROT_LOG_INTERVAL,
        ),
    ]

    def _resolve_settings_schema_map(self, default_pyarrow_schema: pa.Schema | None = None) -> None:
        """Bind the UniProt CDM transform and schemas to the entry table."""
        self._bind_cdm_transform_and_schemas(
            make_uniprot_cdm_transform(),
            UNIPROT_CDM_SCHEMA_MAP,
            default_pyarrow_schema=default_pyarrow_schema,
        )