bauplan.schema module

class bauplan.schema.APIMetadata(*, error: str | None, pagination_token: str | None, request_id: str | None, request_ts: int | None, request_ms: int | None)

Bases: _BauplanData

error : str | None
model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'error': FieldInfo(annotation=Union[str, NoneType], required=True), 'pagination_token': FieldInfo(annotation=Union[str, NoneType], required=True), 'request_id': FieldInfo(annotation=Union[str, NoneType], required=True), 'request_ms': FieldInfo(annotation=Union[int, NoneType], required=True), 'request_ts': FieldInfo(annotation=Union[int, NoneType], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

pagination_token : str | None
request_id : str | None
request_ms : int | None
request_ts : int | None
class bauplan.schema.APIResponse

Bases: _BauplanData

data : Any
metadata : APIMetadata
model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'data': FieldInfo(annotation=Any, required=True), 'metadata': FieldInfo(annotation=APIMetadata, required=True), 'ref': FieldInfo(annotation=Union[Ref, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

ref : Ref | None
class bauplan.schema.Actor(*, name: str, email: str | None)

Bases: _BauplanData

email : str | None
model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'email': FieldInfo(annotation=Union[str, NoneType], required=True), 'name': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

name : str
class bauplan.schema.Branch(*, name: str, hash: str, metadata: RefMetadata | None = None)

Bases: Ref

model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'hash': FieldInfo(annotation=str, required=True), 'metadata': FieldInfo(annotation=Union[RefMetadata, NoneType], required=False, default=None), 'name': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

class bauplan.schema.Commit

Bases: _BauplanData

property author : Actor
authored_date : datetime
authors : list[Actor]
committed_date : datetime
committer : Actor
message : str | None
model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'authored_date': FieldInfo(annotation=datetime, required=True), 'authors': FieldInfo(annotation=list[Actor], required=True), 'committed_date': FieldInfo(annotation=datetime, required=True), 'committer': FieldInfo(annotation=Actor, required=True), 'message': FieldInfo(annotation=Union[str, NoneType], required=True), 'parent_hashes': FieldInfo(annotation=list[str], required=True), 'parent_ref': FieldInfo(annotation=Ref, required=True), 'ref': FieldInfo(annotation=Ref, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

parent_hashes : list[str]
parent_ref : Ref
ref : Ref
class bauplan.schema.Entry(*, name: str, namespace: str, kind: str)

Bases: _BauplanData

property fqn : str
kind : str
model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'kind': FieldInfo(annotation=str, required=True), 'name': FieldInfo(annotation=str, required=True), 'namespace': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

name : str
namespace : str
class bauplan.schema.GetBranchesResponse(data_fetcher: Callable[[int, str | None], APIResponse], data_mapper: Callable[[dict[str, Any]], T], itersize: int, limit: int | None = None)

Bases: _BauplanIterableCatalogAPIResponse[Branch]

class bauplan.schema.GetCommitsResponse(data_fetcher: Callable[[int, str | None], APIResponse], data_mapper: Callable[[dict[str, Any]], T], itersize: int, limit: int | None = None)

Bases: _BauplanIterableCatalogAPIResponse[Commit]

class bauplan.schema.GetNamespacesResponse(data_fetcher: Callable[[int, str | None], APIResponse], data_mapper: Callable[[dict[str, Any]], T], itersize: int, limit: int | None = None)

Bases: _BauplanIterableCatalogAPIResponse[Namespace]

class bauplan.schema.GetTablesResponse(data_fetcher: Callable[[int, str | None], APIResponse], data_mapper: Callable[[dict[str, Any]], T], itersize: int, limit: int | None = None)

Bases: _BauplanIterableCatalogAPIResponse[Table]

class bauplan.schema.Job(*, id: str, kind: str, user: str, status: str, created_at: datetime | None, finished_at: datetime | None)

Bases: BaseModel

EXPERIMENTAL AND SUBJECT TO CHANGE.

Job is a model for a job in the Bauplan system. It is tracked as a result of a code snapshot run.

created_at : datetime | None
finished_at : datetime | None
classmethod from_proto(job_pb: JobInfo) Job
id : str
kind : str
model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'created_at': FieldInfo(annotation=Union[datetime, NoneType], required=True), 'finished_at': FieldInfo(annotation=Union[datetime, NoneType], required=True), 'id': FieldInfo(annotation=str, required=True), 'kind': FieldInfo(annotation=str, required=True), 'status': FieldInfo(annotation=str, required=True), 'user': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

status : str
user : str
class bauplan.schema.JobLog(*, message: str, stream: JobLogStream)

Bases: BaseModel

EXPERIMENTAL AND SUBJECT TO CHANGE.

JobLog is a model for a log message from a job.

When you output logs within a Python model, they are persisted as JobLogs.

classmethod from_proto(log_pb: RunnerEvent) JobLog
message : str
model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'message': FieldInfo(annotation=str, required=True), 'stream': FieldInfo(annotation=JobLogStream, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

stream : JobLogStream
class bauplan.schema.JobLogStream(value)

Bases: Enum

An enumeration.

STDERR = 1
STDOUT = 0
class bauplan.schema.Namespace(*, name: str)

Bases: _BauplanData

model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'name': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

name : str
class bauplan.schema.PartitionField(*, name: str, transform: str)

Bases: _BauplanData

model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'name': FieldInfo(annotation=str, required=True), 'transform': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

name : str
transform : str
class bauplan.schema.Ref(*, name: str, hash: str, metadata: RefMetadata | None = None)

Bases: _BauplanData

A branch or a tag

classmethod from_dict(data: dict) Ref
hash : str
metadata : RefMetadata | None
model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'hash': FieldInfo(annotation=str, required=True), 'metadata': FieldInfo(annotation=Union[RefMetadata, NoneType], required=False, default=None), 'name': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

name : str
class bauplan.schema.RefMetadata(*, message: str, committer: str, authors: list[str], commit_time: str, author_time: str, parent_commit_hashes: list[str], num_commits_ahead: int | None, num_commits_behind: int | None, common_ancestor_hash: str | None, num_total_commits: int)

Bases: _BauplanData

Some metadata about a reference.

author_time : str
authors : list[str]
commit_time : str
committer : str
common_ancestor_hash : str | None
classmethod from_dict(metadata: dict | None = None) RefMetadata | None

Convert a dictionary of reference metadata to a DataCatalogRefMetadata object.

message : str
model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'author_time': FieldInfo(annotation=str, required=True), 'authors': FieldInfo(annotation=list[str], required=True), 'commit_time': FieldInfo(annotation=str, required=True), 'committer': FieldInfo(annotation=str, required=True), 'common_ancestor_hash': FieldInfo(annotation=Union[str, NoneType], required=True), 'message': FieldInfo(annotation=str, required=True), 'num_commits_ahead': FieldInfo(annotation=Union[int, NoneType], required=True), 'num_commits_behind': FieldInfo(annotation=Union[int, NoneType], required=True), 'num_total_commits': FieldInfo(annotation=int, required=True), 'parent_commit_hashes': FieldInfo(annotation=list[str], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

num_commits_ahead : int | None
num_commits_behind : int | None
num_total_commits : int
parent_commit_hashes : list[str]
class bauplan.schema.Table(*, name: str, namespace: str, kind: str = 'TABLE')

Bases: Entry

kind : str
model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'kind': FieldInfo(annotation=str, required=False, default='TABLE'), 'name': FieldInfo(annotation=str, required=True), 'namespace': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

class bauplan.schema.TableField(*, id: int, name: str, required: bool, type: str)

Bases: _BauplanData

id : int
model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'id': FieldInfo(annotation=int, required=True), 'name': FieldInfo(annotation=str, required=True), 'required': FieldInfo(annotation=bool, required=True), 'type': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

name : str
required : bool
type : str
class bauplan.schema.TableWithMetadata(*, name: str, namespace: str, kind: str = 'TABLE', id: str, records: int | None, size: int | None, last_updated_ms: int, fields: list[TableField], snapshots: int | None, partitions: list[PartitionField], metadata_location: str, current_snapshot_id: int | None, current_schema_id: int | None, raw: dict | None)

Bases: Table

current_schema_id : int | None
current_snapshot_id : int | None
fields : List[TableField]
id : str
last_updated_ms : int
metadata_location : str
model_computed_fields : ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config : ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields : ClassVar[Dict[str, FieldInfo]] = {'current_schema_id': FieldInfo(annotation=Union[int, NoneType], required=True), 'current_snapshot_id': FieldInfo(annotation=Union[int, NoneType], required=True), 'fields': FieldInfo(annotation=List[TableField], required=True), 'id': FieldInfo(annotation=str, required=True), 'kind': FieldInfo(annotation=str, required=False, default='TABLE'), 'last_updated_ms': FieldInfo(annotation=int, required=True), 'metadata_location': FieldInfo(annotation=str, required=True), 'name': FieldInfo(annotation=str, required=True), 'namespace': FieldInfo(annotation=str, required=True), 'partitions': FieldInfo(annotation=List[PartitionField], required=True), 'raw': FieldInfo(annotation=Union[Dict, NoneType], required=True), 'records': FieldInfo(annotation=Union[int, NoneType], required=True), 'size': FieldInfo(annotation=Union[int, NoneType], required=True), 'snapshots': FieldInfo(annotation=Union[int, NoneType], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

partitions : List[PartitionField]
raw : Dict | None
records : int | None
size : int | None
snapshots : int | None
bauplan.schema.proto_datetime_to_py_datetime(ts: Timestamp) datetime | None