ueshin commented on a change in pull request #35296:
URL: https://github.com/apache/spark/pull/35296#discussion_r791995794
##########
File path: python/pyspark/pandas/generic.py
##########
@@ -978,6 +981,9 @@ def to_json(
0 a
1 c
"""
+ default_options: Dict[str, Any] = {"ignoreNullFields": False}
+ options = {**default_options, **options}
Review comment:
Merging the default_options should be after line 988.
```py
if "options" in options and isinstance(options.get("options"), dict)
and len(options) == 1:
options = options.get("options")
options = {**default_options, **options}
```
otherwise the if-clause never takes effect.
The if-clause is to help misuse of `options` keyword argument, e.g.,:
```py
psdf.to_json( ..., options={"ignoreNullFields": True})
```
--
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]