TidyLakeContext
Source code in src/tidylake/core/context.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 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 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | |
get_config
classmethod
get_config(config_file: str) -> dict
Load the configuration from a YAML file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_file
|
str
|
The path to the configuration file. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The loaded configuration. |
Source code in src/tidylake/core/context.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
load_plugin
classmethod
load_plugin(
plugin_name: str,
plugin_config: dict,
config_dir: Path = None,
) -> None
Load a plugin dynamically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plugin_config
|
dict
|
The configuration for the plugin. |
required |
config_dir
|
Path
|
Directory to resolve relative plugin paths from. |
None
|
Source code in src/tidylake/core/context.py
39 40 41 42 43 44 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 | |
add_data_product
add_data_product(data_product: DataProduct) -> None
Add a data product to the context instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_product
|
DataProduct
|
The data product to add. |
required |
Source code in src/tidylake/core/context.py
102 103 104 105 106 107 108 109 110 111 112 113 114 | |
get_data_product
get_data_product(name: str) -> DataProduct
Get a specific data product from the current context instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the data product to retrieve. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
DataProduct |
DataProduct
|
The requested data product instance. |
Source code in src/tidylake/core/context.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
get_graph_sequence
get_graph_sequence() -> list[str]
This also checks for topological problems
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: A list of data product names in the order they should be executed. |
Source code in src/tidylake/core/context.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
get_dependencies
get_dependencies() -> dict[str, tuple[str, ...]]
Return a shallow copy of the dependency map (data product -> required inputs).
Returns:
| Type | Description |
|---|---|
dict[str, tuple[str, ...]]
|
dict[str, tuple[str, ...]]: Mapping of each data product to its declared inputs. |
Source code in src/tidylake/core/context.py
150 151 152 153 154 155 156 157 158 | |
run_data_product
run_data_product(name: str)
Run a specific data product by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the data product to run. |
required |
Source code in src/tidylake/core/context.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
run
run(name: str, continue_run: bool = False) -> None
Run the process, given the initial conditions
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the data product to start from. |
required |
continue_run
|
bool
|
If True, continue from the last data product, otherwise run a single data product. |
False
|
Source code in src/tidylake/core/context.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
visualize
visualize(
mermaid: bool = False, textual: bool = False
) -> None
Visualize the run in different formats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mermaid
|
bool
|
If True, generate a Mermaid diagram. |
False
|
textual
|
bool
|
If True, open a Textual TUI to inspect the graph. |
False
|
Source code in src/tidylake/core/context.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | |
peek_data_product
peek_data_product(name: str) -> None
Peek into a specific data product by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the data product to peek into. |
required |
Source code in src/tidylake/core/context.py
263 264 265 266 267 268 269 270 271 272 273 274 275 276 | |
schema_diff
schema_diff(name: str = None) -> None
Return schema differences for the selected data products.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of a specific data product to check. If None, check all data products. Defaults to None. |
None
|
Source code in src/tidylake/core/context.py
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | |
schema_update
schema_update(
name: str = None, commit: bool = False
) -> None
Update or create the schema in the compute engine catalog for the selected data products.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of a specific data product to update. If None, update all data products. Defaults to None. |
None
|
commit
|
bool
|
If True, perform the update/create operation. If False, only print what would be done. |
False
|
Source code in src/tidylake/core/context.py
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | |