Types
laktory.enums.DataFrameBackends
¤
Bases: str, Enum
| METHOD | DESCRIPTION |
|---|---|
from_df |
Instantiate DataFrameBackends object from a DataFrame. |
from_nw_implementation |
Instantiate DataFrameBackends object from a Narwhals implementation. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
POLARS |
Polars backend.
|
PYSPARK |
PySpark backend.
|
POLARS = auto()
class-attribute
instance-attribute
¤
Polars backend.
PYSPARK = auto()
class-attribute
instance-attribute
¤
PySpark backend.
from_df(df)
classmethod
¤
Instantiate DataFrameBackends object from a DataFrame.
| PARAMETER | DESCRIPTION |
|---|---|
df
|
DataFrame
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
output
|
DataFrameBackend
TYPE:
|
Source code in laktory/enums.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
from_nw_implementation(implementation)
classmethod
¤
Instantiate DataFrameBackends object from a Narwhals implementation.
| PARAMETER | DESCRIPTION |
|---|---|
implementation
|
Narwhals implementation
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
output
|
DataFrameBackend
TYPE:
|
Source code in laktory/enums.py
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 | |
laktory.typing.VariableType
¤
Bases: str
A string placeholder that defers field resolution to inject_vars().
Any model field accepting VariableType in addition to its declared type,
allows values to be specified as variable references or expressions in
YAML configs and resolved at deploy time.
The string must start with ${ - arbitrary strings are not accepted.
Two syntaxes are supported:
- Simple substitution:
${vars.my_variable_name} - Python expression:
${{ 4 if vars.env == 'prod' else 1 }}
Examples:
num_workers: ${vars.workers}
size: ${{ 4 if vars.env == 'prod' else 1 }}
access_controls: ${vars.default_access_controls}