You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "jrhaberstroh (via GitHub)" <gi...@apache.org> on 2023/06/26 18:06:58 UTC

[GitHub] [spark] jrhaberstroh commented on a diff in pull request #41686: [SPARK-44137] Change handling of iterable objects for `on` field in joins

jrhaberstroh commented on code in PR #41686:
URL: https://github.com/apache/spark/pull/41686#discussion_r1242571233


##########
python/pyspark/sql/utils.py:
##########
@@ -282,3 +284,41 @@ def get_dataframe_class() -> Type["DataFrame"]:
         return ConnectDataFrame  # type: ignore[return-value]
     else:
         return PySparkDataFrame
+
+def isinstance_iterable(obj: Any) -> bool:
+    """
+    Check for iterability (with string-safe and Column-safe modifications).
+    """
+    if isinstance(obj, str):
+        return False
+    try:
+        iter(obj)
+        return True
+    except (TypeError, PySparkTypeError):

Review Comment:
   PySparkTypeError is a TypeError -- should this be removed due to redundancy, or should the dependency be kept explicit?



-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org