You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Adithya Ajith (Jira)" <ji...@apache.org> on 2026/05/13 20:37:00 UTC

[jira] [Commented] (SPARK-56854) Filter None values in PySpark DataFrame[Stream]Reader/Writer .option(s) for parity with Spark Connect

    [ https://issues.apache.org/jira/browse/SPARK-56854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18080768#comment-18080768 ] 

Adithya Ajith commented on SPARK-56854:
---------------------------------------

Hi, I would like to work on this issue.

> Filter None values in PySpark DataFrame[Stream]Reader/Writer .option(s) for parity with Spark Connect
> -----------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-56854
>                 URL: https://issues.apache.org/jira/browse/SPARK-56854
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 5.0.0
>            Reporter: Lavan Vivekanandasarma
>            Priority: Major
>
> Classic PySpark's DataFrame[Stream]Reader/Writer.option(key, None) and .options(**\{k: None}) forward None to the JVM as Java null. This diverges from the Spark Connect Python client (which has filtered None since SPARK-49263) and from OptionUtils._set_opts at python/pyspark/sql/readwriter.py:41-53, which already filters None.
> Example: spark.read.options(nullValue=None).schema("a STRING, b STRING").csv(path)
> For a row '"",val', Classic returns [Row(a='', b='val')] while Connect returns [Row(a=None, b='val')].
> Proposal: filter None from the public option and options methods on DataFrameReader, DataFrameWriter, DataFrameWriterV2, DataStreamReader, and DataStreamWriter, so Classic matches Connect and _set_opts. After the change, option(k, None) is a no-op and options(**\{k: None}) drops None entries before forwarding.



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