Index
Typed-diff pipeline: walk two states, resolve dependencies, render SQL.
AzureDatabricksOptions
¶
Bases: BaseModel
Azure Databricks-specific render-time options grouped by object type.
These options are not tracked in state and are not crawled from the
database. They influence rendering only — currently only the
CREATE TABLE statement (via tables.properties). As a result,
changes to these options apply to newly created objects only; existing
objects are left untouched. Future object groups (views etc.) will
be added as sibling sub-blocks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tables
|
Options applied to table-creation statements. |
required |
Source code in src/cloe_delta_table_manager/diff/databricks_statement_generator.py
ColumnAdded
¶
Bases: Diff
A new column appeared on an existing or newly-added table.
Source code in src/cloe_delta_table_manager/diff/diff.py
ColumnChanged
¶
Bases: Diff
A column matched by name has one or more differing fields between states.
Source code in src/cloe_delta_table_manager/diff/diff.py
ColumnRemoved
¶
Bases: Diff
A column present in current state is gone in desired state.
Source code in src/cloe_delta_table_manager/diff/diff.py
DatabaseAdded
¶
DatabaseChanged
¶
DatabaseRemoved
¶
DatabricksStatementGenerator
¶
Render typed diffs to Databricks SQL via in-code match-dispatch.
Unsupported deltas are detected generically: a per-class registry of
handled fields runs as a pre-check before the match dispatch. Any
*Changed diff that touches a field outside its allow-list is reported
as unsupported — no silent no-ops, even for diff types added in the
future. To add support for a new field on an existing *Changed class,
register it in :attr:_HANDLED_CHANGED_FIELDS and extend the renderer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
on_unsupported
|
OnUnsupported
|
|
'fail'
|
Source code in src/cloe_delta_table_manager/diff/databricks_statement_generator.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
__init__(*, on_unsupported='fail', options=None)
¶
Initialize the generator with an unsupported-diff handling mode and options.
Source code in src/cloe_delta_table_manager/diff/databricks_statement_generator.py
generate(diff)
¶
Return the SQL commands for a single diff (zero, one, or many).
Source code in src/cloe_delta_table_manager/diff/databricks_statement_generator.py
Diff
¶
Bases: BaseModel
Base class for all database-object diffs.
Carries only identity (id) and dependency wiring (depends_on).
Semantics live entirely in the subclass.
Source code in src/cloe_delta_table_manager/diff/diff.py
DiffDependencyResolver
¶
Wires depends_on between typed diffs based on containment.
Source code in src/cloe_delta_table_manager/diff/diff_dependency_resolver.py
resolve(diffs)
¶
Populate depends_on in place and return the same list.
Source code in src/cloe_delta_table_manager/diff/diff_dependency_resolver.py
DiffResolver
¶
Walk two DatabaseState trees and emit typed diffs.
Emission order is top-down: parent diffs appear before their children in
the returned list. Execution ordering for downstream stages is handled by
:class:DiffDependencyResolver via depends_on.
Source code in src/cloe_delta_table_manager/diff/diff_resolver.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
diff(current, desired)
¶
Return the typed diff list to transform current into desired.
Source code in src/cloe_delta_table_manager/diff/diff_resolver.py
PrimaryKeyChanged
¶
Bases: Diff
The primary-key column set of a table changed between states.
A primary key is a table-level concept — a table has at most one primary
key, possibly spanning several columns — so it is modelled as a single
table-scoped diff rather than per-column is_key flips. old_key_columns
and new_key_columns hold the ordered key-column names; an empty list
means "no primary key" on that side.
Source code in src/cloe_delta_table_manager/diff/diff.py
SchemaAdded
¶
SchemaChanged
¶
SchemaRemoved
¶
TableAdded
¶
TableChanged
¶
Bases: Diff
A table matched by name has differing metadata between states.
Source code in src/cloe_delta_table_manager/diff/diff.py
TableOptions
¶
Bases: BaseModel
Render-time options that apply to CREATE TABLE statements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
properties
|
Key-value pairs emitted as |
required |
Source code in src/cloe_delta_table_manager/diff/databricks_statement_generator.py
TableRemoved
¶
UnsupportedDiffError
¶
Bases: Exception
Raised when a diff has no Databricks SQL representation.
Carries the offending diff so the caller can decide how to surface it.
Source code in src/cloe_delta_table_manager/diff/databricks_statement_generator.py
__init__(diff, reason)
¶
Build the error with the offending diff and a human-readable reason.