-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-32320][PYSPARK] Remove mutable default arguments #29122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6b0f39f
8e9f3c5
e699c49
ee7a763
1da61d4
cb04d54
e011266
1b5a7aa
8c1ce4a
0e372ca
b628156
c75cd57
11f3790
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,8 +80,10 @@ def _invoke_binary_math_function(name, col1, col2): | |
| ) | ||
|
|
||
|
|
||
| def _options_to_str(options): | ||
| return {key: to_str(value) for (key, value) in options.items()} | ||
| def _options_to_str(options=None): | ||
| if options: | ||
| return {key: to_str(value) for (key, value) in options.items()} | ||
| return {} | ||
|
|
||
|
|
||
| def lit(col): | ||
|
|
@@ -3454,7 +3456,7 @@ def json_tuple(col, *fields): | |
| return Column(jc) | ||
|
|
||
|
|
||
| def from_json(col, schema, options={}): | ||
| def from_json(col, schema, options=None): | ||
Fokko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| """ | ||
| Parses a column containing a JSON string into a :class:`MapType` with :class:`StringType` | ||
| as keys type, :class:`StructType` or :class:`ArrayType` with | ||
|
|
@@ -3510,7 +3512,7 @@ def from_json(col, schema, options={}): | |
| return Column(jc) | ||
|
|
||
|
|
||
| def to_json(col, options={}): | ||
| def to_json(col, options=None): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like we still have to modify a few annotations, right? Probably something like functions.pyi.patch.txt
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, I've added them
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why implicit optional is still allowed 🤔 |
||
| """ | ||
| Converts a column containing a :class:`StructType`, :class:`ArrayType` or a :class:`MapType` | ||
| into a JSON string. Throws an exception, in the case of an unsupported type. | ||
|
|
@@ -3557,7 +3559,7 @@ def to_json(col, options={}): | |
| return Column(jc) | ||
|
|
||
|
|
||
| def schema_of_json(json, options={}): | ||
| def schema_of_json(json, options=None): | ||
| """ | ||
| Parses a JSON string and infers its schema in DDL format. | ||
|
|
||
|
|
@@ -3594,7 +3596,7 @@ def schema_of_json(json, options={}): | |
| return Column(jc) | ||
|
|
||
|
|
||
| def schema_of_csv(csv, options={}): | ||
| def schema_of_csv(csv, options=None): | ||
| """ | ||
| Parses a CSV string and infers its schema in DDL format. | ||
|
|
||
|
|
@@ -3627,7 +3629,7 @@ def schema_of_csv(csv, options={}): | |
| return Column(jc) | ||
|
|
||
|
|
||
| def to_csv(col, options={}): | ||
| def to_csv(col, options=None): | ||
| """ | ||
| Converts a column containing a :class:`StructType` into a CSV string. | ||
| Throws an exception, in the case of an unsupported type. | ||
|
|
@@ -4038,7 +4040,7 @@ def sequence(start, stop, step=None): | |
| _to_java_column(start), _to_java_column(stop), _to_java_column(step))) | ||
|
|
||
|
|
||
| def from_csv(col, schema, options={}): | ||
| def from_csv(col, schema, options=None): | ||
| """ | ||
| Parses a column containing a CSV string to a row with the specified schema. | ||
| Returns `null`, in the case of an unparseable string. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.