bauplan.state module

class bauplan.state.ApplyPlanState(job_id: str)

Bases: object

ApplyPlanState tracks information about what happened during the course of an “apply import plan” job that executes the plan to import a table from cloud storage to your Bauplan data catalog.

It represents the state of the job, including job ID, job status (failure/success), error description (if any), and a list of events describing each step of the job.

error : str | None = None
job_id : str
job_status : str | None = None
runner_events : List[RunnerEvent] | None
class bauplan.state.CommonRunState

Bases: object

property duration : float | None
property duration_ns : int | None
ended_at_ns : int | None
job_status : str | None
runner_events : List[RunnerEvent]
runtime_logs : List[RuntimeLogEvent]
started_at_ns : int
tasks_started : Dict[str, datetime]
tasks_stopped : Dict[str, datetime]
user_logs : List[str]
class bauplan.state.PlanImportState(job_id: str)

Bases: object

PlanImportState tracks information about what happened during the course of an “plan import” job that plans a job to import a table from cloud storage to your Bauplan data catalog.

It represents the state of the job, including job ID, job status (failure/success), error description (if any), and a list of events describing each step of the job.

It also includes the output of the job: a string containing the YAML of the import plan.

error : str | None = None
job_id : str
job_status : str | None = None
plan : Dict | None = None
runner_events : List[RunnerEvent] | None
class bauplan.state.ReRunExecutionContext(*, re_run_job_id: str, ref: str, namespace: str, dry_run: bool, transaction: str, strict: str, cache: str, preview: str, debug: bool)

Bases: _BauplanData

cache : str
debug : bool
dry_run : bool
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]] = {'cache': FieldInfo(annotation=str, required=True), 'debug': FieldInfo(annotation=bool, required=True), 'dry_run': FieldInfo(annotation=bool, required=True), 'namespace': FieldInfo(annotation=str, required=True), 'preview': FieldInfo(annotation=str, required=True), 're_run_job_id': FieldInfo(annotation=str, required=True), 'ref': FieldInfo(annotation=str, required=True), 'strict': FieldInfo(annotation=str, required=True), 'transaction': 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.

namespace : str
preview : str
re_run_job_id : str
ref : str
strict : str
transaction : str
class bauplan.state.ReRunState(job_id: str, ctx: ReRunExecutionContext, started_at_ns: int | None = None)

Bases: CommonRunState

ReRunState tracks information about what happened during the course of a Bauplan job rerun (executed DAG).

It represents the state of a run, including job ID, task lifecycle events, user logs, task start and stop times, failed nonfatal task descriptions, job status, and failed fatal task description.

ctx : ReRunExecutionContext
job_id : str
run_id : str
class bauplan.state.RunExecutionContext(*, snapshot_id: str, snapshot_uri: str, project_dir: str, ref: str, namespace: str, dry_run: bool, transaction: str, strict: str, cache: str, preview: str, debug: bool)

Bases: _BauplanData

cache : str
debug : bool
dry_run : bool
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]] = {'cache': FieldInfo(annotation=str, required=True), 'debug': FieldInfo(annotation=bool, required=True), 'dry_run': FieldInfo(annotation=bool, required=True), 'namespace': FieldInfo(annotation=str, required=True), 'preview': FieldInfo(annotation=str, required=True), 'project_dir': FieldInfo(annotation=str, required=True), 'ref': FieldInfo(annotation=str, required=True), 'snapshot_id': FieldInfo(annotation=str, required=True), 'snapshot_uri': FieldInfo(annotation=str, required=True), 'strict': FieldInfo(annotation=str, required=True), 'transaction': 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.

namespace : str
preview : str
project_dir : str
ref : str
snapshot_id : str
snapshot_uri : str
strict : str
transaction : str
class bauplan.state.RunState(job_id: str, ctx: RunExecutionContext, started_at_ns: int | None = None)

Bases: CommonRunState

RunState tracks information about what happened during the course of a Bauplan job run (executed DAG).

It represents the state of a run, including job ID, task lifecycle events, user logs, task start and stop times, failed nonfatal task descriptions, project directory, job status, and failed fatal task description.

ctx : RunExecutionContext
job_id : str | None
class bauplan.state.TableCreatePlanApplyContext(*, debug: bool)

Bases: _BauplanData

debug : bool
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]] = {'debug': FieldInfo(annotation=bool, 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.state.TableCreatePlanApplyState(job_id: str, ctx: TableCreatePlanApplyContext)

Bases: object

TableCreatePlanApplyState tracks information about what happened during the course of an “table create” job that plans a job to create an empty table based on your cloud storage to your Bauplan data catalog.

It represents the state of the job, including job ID, job status (failure/success), error description (if any), and a list of events describing each step of the job.

It also includes the output of the job: a string containing the YAML of the import plan.

ctx : TableCreatePlanApplyContext
error : str | None = None
job_id : str
job_status : str | None = None
plan : str | None = None
runner_events : List[RunnerEvent] | None
class bauplan.state.TableCreatePlanContext(*, branch_name: str, table_name: str, table_replace: bool, table_partitioned_by: str | None, namespace: str, search_string: str, debug: bool)

Bases: _BauplanData

branch_name : str
debug : bool
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]] = {'branch_name': FieldInfo(annotation=str, required=True), 'debug': FieldInfo(annotation=bool, required=True), 'namespace': FieldInfo(annotation=str, required=True), 'search_string': FieldInfo(annotation=str, required=True), 'table_name': FieldInfo(annotation=str, required=True), 'table_partitioned_by': FieldInfo(annotation=Union[str, NoneType], required=True), 'table_replace': FieldInfo(annotation=bool, 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.

namespace : str
search_string : str
table_name : str
table_partitioned_by : str | None
table_replace : bool
class bauplan.state.TableCreatePlanState(job_id: str, ctx: TableCreatePlanContext)

Bases: object

TableCreatePlanState tracks information about what happened during the course of an “table create” job that plans a job to create an empty table based on your cloud storage to your Bauplan data catalog.

It represents the state of the job, including job ID, job status (failure/success), error description (if any), and a list of events describing each step of the job.

It also includes the output of the job: a string containing the YAML of the import plan.

can_auto_apply : bool | None = None
ctx : TableCreatePlanContext
error : str | None = None
files_to_be_imported : List[str]
job_id : str
job_status : str | None = None
plan : Dict | None
runner_events : List[RunnerEvent] | None
class bauplan.state.TableDataImportContext(*, branch_name: str, table_name: str, namespace: str, search_string: str, import_duplicate_files: bool, best_effort: bool, continue_on_error: bool, transformation_query: str | None, preview: str, debug: bool)

Bases: _BauplanData

best_effort : bool
branch_name : str
continue_on_error : bool
debug : bool
import_duplicate_files : bool
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]] = {'best_effort': FieldInfo(annotation=bool, required=True), 'branch_name': FieldInfo(annotation=str, required=True), 'continue_on_error': FieldInfo(annotation=bool, required=True), 'debug': FieldInfo(annotation=bool, required=True), 'import_duplicate_files': FieldInfo(annotation=bool, required=True), 'namespace': FieldInfo(annotation=str, required=True), 'preview': FieldInfo(annotation=str, required=True), 'search_string': FieldInfo(annotation=str, required=True), 'table_name': FieldInfo(annotation=str, required=True), 'transformation_query': FieldInfo(annotation=Union[str, 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.

namespace : str
preview : str
search_string : str
table_name : str
transformation_query : str | None
class bauplan.state.TableDataImportState(job_id: str, ctx: TableDataImportContext)

Bases: object

TableDataImportState tracks information about what happened during the course of an “table create” job that plans a job to create an empty table based on your cloud storage to your Bauplan data catalog.

It represents the state of the job, including job ID, job status (failure/success), error description (if any), and a list of events describing each step of the job.

It also includes the output of the job: a string containing the YAML of the import plan.

ctx : TableDataImportContext
error : str | None = None
job_id : str
job_status : str | None = None
runner_events : List[RunnerEvent] | None