Lee-W commented on code in PR #67184:
URL: https://github.com/apache/airflow/pull/67184#discussion_r3388199934


##########
task-sdk/src/airflow/sdk/definitions/partition_mappers/base.py:
##########
@@ -18,10 +18,21 @@
 
 from typing import TYPE_CHECKING, ClassVar
 
+import attrs
+
 if TYPE_CHECKING:
     from airflow.sdk.definitions.partition_mappers.window import Window
 
 
+def _validate_max_downstream_keys(instance, attribute, value):
+    if value is not None and (not isinstance(value, int) or value < 1):
+        raise ValueError(f"max_downstream_keys must be a positive integer or 
None, got {value!r}")
+
+
+# slots=False: subclasses (RollupMapper, ChainMapper, etc.) define their own
+# __init__ and set instance attributes not declared on the attrs base; a 
slotted
+# base would raise AttributeError when those subclasses write those attributes.
[email protected](slots=False)

Review Comment:
   converted all the SDK mapper subclasses to `attrs` so the base no longer 
needs any `slots`. RollupMapper, 
   
   `AllowedKeyMapper`, the temporal mappers, and `FanOutMapper` uses 
`@attrs.define` now while `ChainMapper/ProductMapper` keeps `__init__` with 
`@attrs.define(init=False)` since the position only args is not supported by 
`attrs` 



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