ashb commented on code in PR #46319:
URL: https://github.com/apache/airflow/pull/46319#discussion_r1937512117


##########
task_sdk/src/airflow/sdk/definitions/mappedoperator.py:
##########
@@ -136,6 +137,22 @@ def ensure_xcomarg_return_value(arg: Any) -> None:
             ensure_xcomarg_return_value(v)
 
 
+def is_mappable_value(value: Any) -> TypeGuard[Collection]:
+    """
+    Whether a value can be used for task mapping.
+
+    We only allow collections with guaranteed ordering, but exclude character
+    sequences since that's usually not what users would expect to be mappable.
+
+    :meta private:
+    """
+    if not isinstance(value, (Sequence, dict)):
+        return False
+    if isinstance(value, (bytearray, bytes, str)):
+        return False
+    return True

Review Comment:
   We didn't before. I just copied this (in my next massive PR the other one 
will be deleted.)
   
   Let me update the source (somewhere in TI.py I think) to use this version



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to