Data¶
Validated types for data engineering: SQL identifiers and Kafka topics.
Data engineering types.
Modules:
-
kafka–Validated types for Apache Kafka identifiers.
-
sql–SQL data types.
Classes:
-
TableIdentifier–A SQL table identifier like schema.table or catalog.schema.table.
Attributes:
-
KafkaTopicName–A valid Apache Kafka topic name (e.g.
my-topic). -
SqlIdentifier–A valid unquoted SQL identifier (e.g.
users).
KafkaTopicName
module-attribute
¶
KafkaTopicName = Annotated[str, AfterValidator(_validate_kafka_topic_name), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A valid Apache Kafka topic name.', 'examples': ['my-topic', 'events.user.created', 'topic_v2'], 'title': 'KafkaTopicName', 'minLength': 1, 'maxLength': 249})]
A valid Apache Kafka topic name (e.g. my-topic).
SqlIdentifier
module-attribute
¶
SqlIdentifier = Annotated[str, AfterValidator(_validate_sql_identifier), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A valid unquoted SQL identifier.', 'examples': ['users', '_private_col', 'TableName'], 'title': 'SqlIdentifier', 'minLength': 1})]
A valid unquoted SQL identifier (e.g. users).
TableIdentifier
¶
Bases: str
A SQL table identifier like schema.table or catalog.schema.table.
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for TableIdentifier.
-
__get_pydantic_json_schema__–Return the JSON schema for TableIdentifier.
-
__new__–Create and validate a new TableIdentifier instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for TableIdentifier.
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for TableIdentifier.
Source code in src/pydantypes/data/sql.py
__new__
¶
__new__(value: str) -> TableIdentifier
Create and validate a new TableIdentifier instance.