diff --git a/dlt/destinations/impl/filesystem/factory.py b/dlt/destinations/impl/filesystem/factory.py index 029a5bdda5..302585b21f 100644 --- a/dlt/destinations/impl/filesystem/factory.py +++ b/dlt/destinations/impl/filesystem/factory.py @@ -1,3 +1,4 @@ +from datetime import datetime import typing as t from dlt.destinations.impl.filesystem.configuration import FilesystemDestinationClientConfiguration @@ -27,6 +28,9 @@ def __init__( credentials: t.Union[FileSystemCredentials, t.Dict[str, t.Any], t.Any] = None, destination_name: t.Optional[str] = None, environment: t.Optional[str] = None, + current_datetime: t.Optional[datetime] = None, + datetime_format: t.Optional[str] = None, + layout_params: t.Optional[t.Dict[str, t.Any]] = None, **kwargs: t.Any, ) -> None: """Configure the filesystem destination to use in a pipeline and load data to local or remote filesystem. @@ -46,12 +50,19 @@ def __init__( credentials: Credentials to connect to the filesystem. The type of credentials should correspond to the bucket protocol. For example, for AWS S3, the credentials should be an instance of `AwsCredentials`. A dictionary with the credentials parameters can also be provided. + current_datetime: current datetime used instead of datetime generated by dlt. + datetime_format: strftime formatting for current_datetime + layout_params: custom layout parameters, all unknown parameters will be skipped, + values can be primitive types or callables which also should return a primitive type. **kwargs: Additional arguments passed to the destination config """ super().__init__( bucket_url=bucket_url, credentials=credentials, destination_name=destination_name, + current_datetime=current_datetime, + datetime_format=datetime_format, + layout_params=layout_params, environment=environment, **kwargs, ) diff --git a/dlt/destinations/path_utils.py b/dlt/destinations/path_utils.py index 047cb274e0..ef06880ff7 100644 --- a/dlt/destinations/path_utils.py +++ b/dlt/destinations/path_utils.py @@ -1,5 +1,5 @@ # this can probably go some other place, but it is shared by destinations, so for now it is here -from typing import List, Sequence, Tuple +from typing import List, Sequence import pendulum import re