Skip to main content

bauplan.state


classExternalTableCreateContextNon-instantiable

The parameters that were passed to an external table creation job.

Attributes

branch_name:

str

Branch the external table is being created on.

namespace:

str

Namespace of the external table.

table_name:

str

Name of the external table to create.


classExternalTableCreateStateNon-instantiable

The state of a completed external table creation job.

Attributes

The parameters that were used to launch the external table creation job.

error:

str | None

Error message, if the job failed.

job_id:

str | None

The job ID assigned by the server.

job_status:

str | None

The final status string (e.g. "SUCCESS", "FAILED").


classRunExecutionContextNon-instantiable

The execution context for a run, capturing the parameters that were used to launch it.

Attributes

cache:

str

Cache mode used for the run ("on" / "off").

debug:

bool

Whether debug logging was enabled for the run.

detach:

bool

Whether the run was submitted in detached (background) mode.

dry_run:

bool

Whether the run was a dry run (no models materialized).

namespace:

str

Namespace the run materialized models into.

preview:

str

Preview mode used for the run ("on", "off", "head", "tail").

project_dir:

str

Local project directory that was packaged and submitted.

ref:

str

Ref (branch or tag) the run was executed against.

snapshot_id:

str

Identifier of the immutable project snapshot that the server executed.

snapshot_uri:

str

URI locating the project snapshot that the server executed.

strict:

str

Strict mode ("on" / "off"). When on, runtime warnings such as failing expectations or invalid column outputs fail the run.

transaction:

str

Transaction mode ("on" / "off"). When on, all models are materialized on a temporary branch and merged atomically on success.


classRunStateNon-instantiable

The state of a completed (or failed) run, including logs, timing, and per-task lifecycle events.

Attributes

The execution context for the run.

duration:

float | None

Duration in seconds, or None if the run hasn't ended.

duration_ns:

int | None

Duration in nanoseconds, or None if the run hasn't ended.

ended_at_ns:

int | None

Epoch nanoseconds when the run ended, if it has.

error:

str | None

Error message, if the run failed.

job_id:

str | None

The job ID assigned by the server.

job_status:

str | None

The final status string (e.g. "SUCCESS", "FAILED").

started_at_ns:

int

Epoch nanoseconds when the run started.

tasks_started:

dict[str, datetime]

Per-task start times, keyed by task ID.

tasks_stopped:

dict[str, datetime]

Per-task stop times, keyed by task ID.

user_logs:

list[JobLogEvent]

User log messages emitted during the run.


classTableCreatePlanApplyStateNon-instantiable

The state of a completed Client.apply_table_creation_plan job, which materializes a previously produced bauplan.state.TableCreatePlanState plan.

Attributes

error:

str | None

Error message, if the apply job failed.

job_id:

str | None

The job ID assigned by the server.

job_status:

str | None

The final status string (e.g. "SUCCESS", "FAILED").


classTableCreatePlanContextNon-instantiable

The parameters that were passed to a Client.plan_table_creation call.

Attributes

branch_name:

str

Branch the table is being created on.

namespace:

str

Namespace the table will be created in.

search_string:

str

URI pattern (e.g. s3://bucket/path/*.parquet) used to discover the source files to plan the table schema from.

table_name:

str

Name of the table to create.

table_partitioned_by:

str | None

Partitioning expression (e.g. a column name or transform) applied to the new table, or None if the table is not partitioned.

table_replace:

bool

Whether an existing table with the same name should be replaced.


classTableCreatePlanStateNon-instantiable

The result of a Client.plan_table_creation call.

The plan field contains the schema plan as a YAML string. You can modify it before applying, for example to add partitioning:

import bauplan
import yaml

client = bauplan.Client()
plan_state = client.plan_table_creation('my_table', 's3://bucket/path/*.parquet')
plan = yaml.safe_load(plan_state.plan)
plan['schema_info']['partitions'] = [
{
'from_column_name': 'datetime_column',
'transform': {'name': 'year'},
}
]
modified_plan = yaml.dump(plan)

Attributes

can_auto_apply:

bool

Whether the plan has no schema conflicts and can be applied without manual intervention. If False, the caller must resolve conflicts in plan before applying.

The parameters that were used to launch the planning job.

error:

str | None

Error message, if the planning job failed.

files_to_be_imported:

list[str]

The list of source files that the plan matched and will be imported when the plan is applied.

job_id:

str | None

The job ID assigned by the server.

job_status:

str | None

The final status string (e.g. "SUCCESS", "FAILED").

plan:

str | None

The generated schema plan as a YAML string. You can edit this before calling Client.apply_table_creation_plan (for example to add partitioning).


classTableDataImportContextNon-instantiable

The parameters that were passed to a data import job.

Attributes

best_effort:

bool

If True, ignore source columns that do not exist on the destination table instead of failing the import.

branch_name:

str

Branch the data is being imported into.

continue_on_error:

bool

If True, do not fail the job when individual files fail to import.

import_duplicate_files:

bool

If True, re-import files that have already been imported. This may result in duplicate rows.

namespace:

str

Namespace of the destination table.

preview:

str

Preview mode used for the import ("on", "off", "head", "tail").

search_string:

str

URI pattern (e.g. s3://bucket/path/*.parquet) used to locate the source files to import.

table_name:

str

Name of the destination table.

transformation_query:

str | None

Optional SQL transformation applied to each file during import.


classTableDataImportStateNon-instantiable

The state of a completed data import job.

Attributes

The parameters that were used to launch the import job.

error:

str | None

Error message, if the import job failed.

job_id:

str | None

The job ID assigned by the server.

job_status:

str | None

The final status string (e.g. "SUCCESS", "FAILED").