AzureDestination
class AzureDestination(
uri: str | List[str],
credentials: dict | AzureCredentials,
format: str | dict | FileFormat = None,
)
Bases: DestinationPlugin
Categories: destination
Class for managing the configuration of Azure-file-based data outputs.
Attributes: format (FileFormat): The format of the file to be created. If not provided, it will be inferred from the file extension. uri (str | List[str]): The URI of the files with format: 'az://path/to/files'. It can be a single URI or a list of URIs. credentials (AzureCredentials): The credentials required to access Azure.
Initializes the AzureDestination with the given URI and the credentials required to access Azure; and optionally a format.
Parameters
uristr | List[str]The URI of the files to export with format: 'az://path/to/files'. It can be a single URI or a list of URIs.
credentialsdict | AzureCredentialsThe credentials required to access Azure. Can be a dictionary or a AzureCredentials object.
formatstr | dict | FileFormat, optionalThe format of the file. If not provided, it will be inferred from the file extension. Can be either a string with the format, a FileFormat object or a dictionary with the format as the 'type' key and any additional format-specific information. Currently supported formats are 'csv', 'parquet', 'ndjson' and 'jsonl'.
Raises
OutputConfigurationError FormatConfigurationError
Properties
allow_fragmentsboolWhether to allow fragments in the output.
credentialsAzureCredentialsThe credentials required to access Azure.
formatFileFormatThe format of the file. If not provided, it will be inferred from the file extension of the URI.
uristr | List[str]The URI of the files with format: 'az://path/to/files'.
SupportedFormatsclass SupportedFormats(*args, **kwds)
Bases: Enum
Enum for the supported formats for the AzureDestination.
csvndjsonparquetMethods
chunkdef chunk(working_dir: str, *results)
Trigger the exporting of the data to local parquet chunks. This method will receive the resulting data from the user function and must store it in the local system as parquet files, using the working_dir. Note: This method should not materialize the data, it should only store it in the local system.
Parameters:
working_dirstrThe folder where any files generated must be stored (this refers to temporary files that will be deleted after the execution of the plugin, not the final destination of the data)
resultsThe data to be exported. It is a list of polars LazyFrames or None.
Returns:
A list of the intermediate files created
streamdef stream(working_dir: str, *results)
Trigger the exporting of the data. This method will receive the resulting data from the user function and must store it in the desired location. Note: this method might materialize the data provided in a single chunk generated by the chunk function if invoked, so chunks should be of an appropriate size.
Parameters:
working_dirstrThe folder where any intermediate files generated must be stored (this refers to temporary files that will be deleted after the execution of the plugin, not the final destination of the data)
resultsThe data to be exported. It is a list of polars LazyFrames or None.
Returns:
None