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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to