Lee-W commented on code in PR #69311:
URL: https://github.com/apache/airflow/pull/69311#discussion_r3518903604
##########
airflow-core/src/airflow/partition_mappers/fixed_key.py:
##########
@@ -46,20 +43,24 @@ class FixedKeyMapper(PartitionMapper):
:raises ValueError: if *downstream_key* is not a non-empty ``str``.
"""
- downstream_key: str = attrs.field()
-
- @downstream_key.validator
- def _validate_downstream_key(self, attribute: attrs.Attribute, value: str)
-> None:
- if not isinstance(value, str) or value == "":
- raise ValueError(f"FixedKeyMapper downstream_key must be a
non-empty str; got {value!r}.")
+ def __init__(self, downstream_key: str, *, max_downstream_keys: int | None
= None) -> None:
+ if not isinstance(downstream_key, str) or downstream_key == "":
Review Comment:
I thought we didn't like this practice in airflow. But yep, like 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]