zhengruifeng opened a new pull request, #48589:
URL: https://github.com/apache/spark/pull/48589

   ### What changes were proposed in this pull request?
   Make `lit` works with empty numpy ndarray
   
   
   ### Why are the changes needed?
   bug fix, to make it consistent with the PySpark Classic
   
   
   ### Does this PR introduce _any_ user-facing change?
   before:
   ```
   In [7]: spark.range(1).select(sf.lit(np.array([], np.int32))).schema
   Out[7]: StructType([StructField('array()', ArrayType(NullType(), False), 
False)])
   ```
   
   after:
   ```
   In [3]: spark.range(1).select(sf.lit(np.array([], np.int32))).schema
   Out[3]: StructType([StructField('array()', ArrayType(IntegerType(), True), 
False)])
   ```
   
   
   ### How was this patch tested?
   added tests
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   no
   


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