Config models¶
- class schemashift.FormatConfig(**data)[source]¶
Bases:
BaseModelTop-level configuration for a single source format.
- model_dump(**kwargs)[source]¶
Override to serialise ColumnMapping fields respecting the _UNSET sentinel.
- model_dump_json(**kwargs)[source]¶
Override to serialise ColumnMapping fields respecting the _UNSET sentinel.
- Return type:
- source_columns()[source]¶
Return all source column names referenced in this config.
Includes direct ‘source’ fields and all col(”…”) references inside ‘expr’ fields, extracted by walking the DSL AST rather than regex-matching strings.
- columns: list[ColumnMapping]¶
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- reader: ReaderConfig¶
- class schemashift.ColumnMapping(**data)[source]¶
Bases:
BaseModelDescribes how to produce one output column.
- model_dump_json(**kwargs)[source]¶
Override to omit sentinel-valued fields from the JSON output.
- Return type:
- dtype: Literal['str', 'string', 'utf8', 'int8', 'int16', 'int32', 'int64', 'integer', 'uint8', 'uint16', 'uint32', 'uint64', 'float32', 'float64', 'number', 'bool', 'boolean', 'date', 'datetime', 'time', 'duration', 'binary', 'categorical', 'null'] | None¶
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class schemashift.ReaderConfig(**data)[source]¶
Bases:
BaseModelLow-level options passed to the file reader.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class schemashift.TargetSchema(**data)[source]¶
Bases:
BaseModelDefines the expected shape and types of an output DataFrame.
- validate_eager(df)[source]¶
Full validation: columns, dtypes, and null checks on required columns.
- Raises:
SchemaValidationError – with details of all issues found.
- Return type:
- validate_lazy(lf)[source]¶
Validate column names and dtypes against the LazyFrame schema.
Does not collect data — checks structural metadata only.
- Raises:
SchemaValidationError – listing all missing columns and type mismatches.
- Return type:
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].