daft.functions.upload#
upload #
upload(expr: Expression, location: str | Expression, max_connections: int = 32, on_error: Literal['raise', 'null'] = 'raise', io_config: IOConfig | None = None) -> Expression
Uploads a column of binary data to the provided location(s) (also supports S3, local etc).
Files will be written into the location (folder(s)) with a generated UUID filename, and the result will be returned as a column of string paths that is compatible with the download() Expression.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expr | Expression | The expression to upload. | required |
location | str | Expression | a folder location or column of folder locations to upload data into | required |
max_connections | int | The maximum number of connections to use per thread to use for uploading data. Defaults to 32. | 32 |
on_error | Literal['raise', 'null'] | Behavior when a URL upload error is encountered - "raise" to raise the error immediately or "null" to log the error but fallback to a Null value. Defaults to "raise". | 'raise' |
io_config | IOConfig | None | IOConfig to use when uploading data | None |
Returns:
| Name | Type | Description |
|---|---|---|
Expression | Expression | a String expression containing the written filepath |
Examples:
1 2 3 | |
Upload to row-specific URLs
1 | |
Source code in daft/functions/url.py
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 | |