Lee-W commented on code in PR #64571:
URL: https://github.com/apache/airflow/pull/64571#discussion_r3200126760
##########
task-sdk/src/airflow/sdk/definitions/partition_mappers/temporal.py:
##########
@@ -44,16 +44,28 @@ class StartOfDayMapper(_BaseTemporalMapper):
class StartOfWeekMapper(_BaseTemporalMapper):
- """Map a time-based partition key to week."""
+ """Map a time-based partition key to the start of its week."""
default_output_format = "%Y-%m-%d (W%V)"
+ def __init__(self, *, week_start: int = 0, **kwargs) -> None:
+ if not 0 <= week_start <= 6:
+ raise ValueError(f"week_start must be between 0 (Monday) and 6
(Sunday), got {week_start!r}")
+ super().__init__(**kwargs)
+ self.week_start = week_start
+
class StartOfMonthMapper(_BaseTemporalMapper):
- """Map a time-based partition key to month."""
+ """Map a time-based partition key to the start of its month."""
Review Comment:
removed as discussed
--
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]