Yicong-Huang opened a new pull request, #54092: URL: https://github.com/apache/spark/pull/54092
### What changes were proposed in this pull request? Refactor `createDataFrame` to always infer a full `StructType` schema when user provides `None` or column names only. **Before:** Three separate code paths for `schema=None`, `schema=["col1"]`, and `schema=StructType(...)` **After:** One unified path - if schema is not `StructType`, infer full `StructType` from Arrow types first ### Why are the changes needed? Simplifies code by consolidating duplicate schema inference logic and ensures `spark_types` is never `None`. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing tests: `python/pyspark/sql/tests/arrow/test_arrow.py` ### 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]
