Lee-W commented on code in PR #66030:
URL: https://github.com/apache/airflow/pull/66030#discussion_r3360391000
##########
airflow-core/tests/unit/serialization/test_serialized_objects.py:
##########
@@ -1105,6 +1105,72 @@ def test_decode_product_mapper():
assert core_pm.to_downstream("2024-06-15T10:30:00|2024-06-15T10:30:00") ==
"2024-06-15T10|2024-06-15"
+def test_encode_fan_out_mapper():
+ from airflow.sdk import FanOutMapper, StartOfDayMapper, StartOfWeekMapper,
WeekWindow
+ from airflow.serialization.encoders import encode_partition_mapper
+
+ partition_mapper = FanOutMapper(
+ upstream_mapper=StartOfWeekMapper(),
+ window=WeekWindow(),
+ downstream_mapper=StartOfDayMapper(),
+ )
+ assert encode_partition_mapper(partition_mapper) == {
+ Encoding.TYPE: "airflow.partition_mappers.temporal.FanOutMapper",
+ Encoding.VAR: {
+ "upstream_mapper": {
+ Encoding.TYPE:
"airflow.partition_mappers.temporal.StartOfWeekMapper",
+ Encoding.VAR: {
Review Comment:
Thanks! Added `"timezone": "UTC"` to bot `upstream_mapper` and
`downstream_mapper` nested VAR blocks.
--
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]