uranusjr commented on code in PR #64571:
URL: https://github.com/apache/airflow/pull/64571#discussion_r3159814419


##########
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:
   “Start” seems weird here since most people wouldn’t mentally model months 
like this. (The week mapper above has the same problem really)
   
   I’m not sure how to best express this concept succinctly. Maybe 
@cmarteepants would have some ideas.



-- 
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]

Reply via email to