diff --git a/dlt/destinations/impl/filesystem/configuration.py b/dlt/destinations/impl/filesystem/configuration.py index 1a5c9f7a81..06940fbf15 100644 --- a/dlt/destinations/impl/filesystem/configuration.py +++ b/dlt/destinations/impl/filesystem/configuration.py @@ -1,6 +1,6 @@ import dataclasses -from typing import Any, Callable, Dict, Final, Type, Optional, Union +from typing import Callable, Dict, Final, Type, Optional, Union from dlt.common.configuration import configspec, resolve_type from dlt.common.destination.reference import ( @@ -32,7 +32,7 @@ class FilesystemDestinationClientConfiguration( # type: ignore[misc] ) current_datetime: Optional[Union[DateTime, TCurrentDatetimeCallback]] = None datetime_format: Optional[TDatetimeFormat] = None - extra_params: Optional[Dict[str, Union[str, TLayoutParamCallback]]] = None + extra_placeholders: Optional[Dict[str, Union[str, TLayoutParamCallback]]] = None @resolve_type("credentials") def resolve_credentials_type(self) -> Type[CredentialsConfiguration]: @@ -40,32 +40,3 @@ def resolve_credentials_type(self) -> Type[CredentialsConfiguration]: return ( self.PROTOCOL_CREDENTIALS.get(self.protocol) or Optional[CredentialsConfiguration] # type: ignore[return-value] ) - - def on_resolved(self) -> None: - """Resolve configuration for filesystem destination - - The following three variables will override the ones from configuration - if supplied via `filesystem(...)` constructor, additionally - when provided `extra_params` will be merged with the values from configuration - however provided values will always override config.toml. - - * current_datetime, - * datetime_format, - * extra_params - """ - if current_datetime := self.kwargs.get("current_datetime"): - self.current_datetime = current_datetime - - datetime_format = self.kwargs.get("datetime_format", self.datetime_format) - if datetime_format is not None: - self.datetime_format = datetime_format - - extra_params_arg: Dict[str, Any] = self.kwargs.get("extra_params", {}) - if not self.extra_params and extra_params_arg: - self.extra_params = {} - - if extra_params_arg: - for key, val in extra_params_arg.items(): - self.extra_params[key] = val - - super().on_resolved() diff --git a/dlt/destinations/impl/filesystem/layout.py b/dlt/destinations/impl/filesystem/layout.py index 3a5fb14255..6a0e14fa10 100644 --- a/dlt/destinations/impl/filesystem/layout.py +++ b/dlt/destinations/impl/filesystem/layout.py @@ -105,8 +105,8 @@ def params(self) -> Optional[Dict[str, Any]]: # For each callable extra parameter # otherwise take it's value - if self.config.extra_params: - for key, value in self.config.extra_params.items(): + if self.config.extra_placeholders: + for key, value in self.config.extra_placeholders.items(): if callable(value): self._params[key] = value( self.schema_name,