DbfsFile
laktory.models.resources.databricks.DbfsFile
¤
Bases: RenderableFileMixin, DbfsFileBase
Databricks DBFS File
Examples:
import io
from laktory import models
file_yaml = '''
source: ./data/stock_prices/prices.json
dirpath: stock_prices/
'''
file = models.resources.databricks.DbfsFile.model_validate_yaml(
io.StringIO(file_yaml)
)
print(file.path)
# > /stock_prices/prices.json
References
| BASE | DESCRIPTION |
|---|---|
content_base64
|
Encoded file contents. Conflicts with
TYPE:
|
md5
|
TYPE:
|
| LAKTORY | DESCRIPTION |
|---|---|
access_controls
|
List of file access controls
TYPE:
|
dirpath
|
Workspace directory inside rootpath in which the DBFS file is deployed. Used only if
TYPE:
|
path_
|
DBFS filepath for the file. Overwrite
TYPE:
|
render_vars
|
If
TYPE:
|
source_
|
The full absolute path to the file. Conflicts with
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
build |
Render |
check_staged |
Raise a clear error if this resource is configured for variable |
| ATTRIBUTE | DESCRIPTION |
|---|---|
filename |
File filename
TYPE:
|
filename
property
¤
File filename
build(vars=None)
¤
Render ${vars.x}/${{ expr }} placeholders in the file content
and stage the result under settings.build_root, if render_vars
is True. No-op otherwise.
Source code in laktory/models/resources/databricks/dbfsfile.py
112 113 114 115 116 117 118 119 | |
check_staged()
¤
Raise a clear error if this resource is configured for variable
rendering but its staged copy hasn't been written yet (i.e.
.build() hasn't run). Guards against programmatic use that
bypasses Stack.build() (the normal CLI flow always calls it
before dumping resources).
Source code in laktory/models/resources/databricks/_renderablefile.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
laktory.models.resources.databricks.dbfsfile.DbfsFileLookup
¤
Bases: ResourceLookup
| PARAMETER | DESCRIPTION |
|---|---|
limit_file_size
|
Do not load content for files larger than 4MB.
TYPE:
|
path
|
Path on DBFS for the file from which to get content.
TYPE:
|