[
https://issues.apache.org/jira/browse/SPARK-44980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hyukjin Kwon updated SPARK-44980:
---------------------------------
Summary: Fix inherited namedtuples to work in createDataFrame (was:
createDataFrame should respect the names namedtuples properly)
> Fix inherited namedtuples to work in createDataFrame
> ----------------------------------------------------
>
> Key: SPARK-44980
> URL: https://issues.apache.org/jira/browse/SPARK-44980
> Project: Spark
> Issue Type: Bug
> Components: Connect, PySpark
> Affects Versions: 3.5.0
> Reporter: Hyukjin Kwon
> Priority: Major
>
> {code}
> from collections import namedtuple
> MyTuple = namedtuple("MyTuple", ["zz", "b", "a"])
> class MyInheritedTuple(MyTuple):
> pass
> df = spark.createDataFrame([MyInheritedTuple(1, 2, 3), MyInheritedTuple(11,
> 22, 33)])
> df.collect()
> {code}
> {code}
> [Row(zz=None, b=None, a=None), Row(zz=None, b=None, a=None)]
> {code}
> should be
> {code}
> [Row(zz=1, b=2, a=3), Row(zz=11, b=22, a=33)]
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]