You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2023/08/28 06:48:00 UTC
[jira] [Assigned] (SPARK-44980) Fix inherited namedtuples to work in createDataFrame
[ https://issues.apache.org/jira/browse/SPARK-44980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyukjin Kwon reassigned SPARK-44980:
------------------------------------
Assignee: Hyukjin Kwon
> 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
> Assignee: 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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org