Lee-W commented on code in PR #62709:
URL: https://github.com/apache/airflow/pull/62709#discussion_r3008405439
##########
airflow-core/src/airflow/partition_mappers/temporal.py:
##########
@@ -30,14 +34,21 @@ class _BaseTemporalMapper(PartitionMapper, ABC):
def __init__(
self,
+ *,
+ timezone: str | Timezone | FixedTimezone = "UTC",
input_format: str = "%Y-%m-%dT%H:%M:%S",
output_format: str | None = None,
):
self.input_format = input_format
self.output_format = output_format or self.default_output_format
+ if isinstance(timezone, str):
+ timezone = parse_timezone(timezone)
+ self._timezone = timezone
def to_downstream(self, key: str) -> str:
dt = datetime.strptime(key, self.input_format)
+ if dt.tzinfo is None:
+ dt = make_aware(dt, self._timezone)
Review Comment:
yep, I think we should. let me update it
--
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]