uranusjr commented on code in PR #68517:
URL: https://github.com/apache/airflow/pull/68517#discussion_r4232391065
##########
airflow-core/src/airflow/timetables/simple.py:
##########
@@ -282,21 +320,28 @@ class PartitionedAssetTimetable(AssetTriggeredTimetable):
def summary(self) -> str:
return "Partitioned Asset"
- def __init__(
- self,
- *,
- assets: SerializedAssetBase,
- partition_mapper_config: dict[SerializedAssetBase, PartitionMapper] |
None = None,
- default_partition_mapper: PartitionMapper = DEFAULT_PARTITION_MAPPER,
- ) -> None:
- super().__init__(assets=assets)
- self.partition_mapper_config = partition_mapper_config or {}
- self.default_partition_mapper = default_partition_mapper
-
- self._name_to_partition_mapper: dict[str, PartitionMapper] = {}
- self._uri_to_partition_mapper: dict[str, PartitionMapper] = {}
+ asset_condition: SerializedAssetBase = attrs.field(alias="assets",
converter=_coerce_asset_condition)
+ partition_mapper_config: dict[SerializedAssetBase, PartitionMapper] =
attrs.field(
+ factory=dict, converter=_coerce_partition_mapper_config
Review Comment:
There’s `attrs.converters.default_if_none`, we don’t need a custom converter
here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]