xinrong-databricks commented on code in PR #36793:
URL: https://github.com/apache/spark/pull/36793#discussion_r895210329


##########
python/pyspark/sql/session.py:
##########
@@ -952,12 +953,29 @@ def createDataFrame(  # type: ignore[misc]
             schema = [x.encode("utf-8") if not isinstance(x, str) else x for x 
in schema]
 
         try:
-            import pandas
+            import pandas as pd
 
             has_pandas = True
         except Exception:
             has_pandas = False
-        if has_pandas and isinstance(data, pandas.DataFrame):
+
+        try:
+            import numpy as np

Review Comment:
   Good point! For consistency with NumPy versions in other modules, 
`numpy>=1.15` is added. 
   
   May I ask what's our rule for deciding the minimum version of a library? 
   
   Currently, we set`pandas>=1.0.5`, which requires `numpy>=1.13.3` (according 
to [pandas 
installation](https://pandas.pydata.org/pandas-docs/version/1.0/getting_started/install.html)).
   
   CC @HyukjinKwon 



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