-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: cleanup docstring for read_json and fix error in contribution guide #27280
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
You will need to merge master to resolve the conflicts
pandas/io/json/json.py
Outdated
|
||
orient : string, | ||
orient : str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orient : str, | |
orient : str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the preferred change, according to the docs, would be str, optional
. However, the (many) other parameters in the docstring just put the default value. I will make it read str, default None
for consistency's sake. I'll leave trudging through the function code and conforming the other parameter descriptions to the preferred style for another day . . .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the fixes in the contributing guide. Did you check that ./scripts/validate_docstrings.py pandas.read_json
doesn't report any error?
pandas/io/json/json.py
Outdated
@@ -473,7 +478,7 @@ def read_json( | |||
|
|||
Returns | |||
------- | |||
result : Series or DataFrame, depending on the value of `typ`. | |||
Series or DataFrame, depending on the value of `typ`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our standard is to leave just the type Series or DataFrame
in this line, and in the next indented to add any explanation. If you can update here, that would be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the examples, if you can open an issue for those that would be great. I don't have a solution for that right now, will require some research.
The default None
vs optional
we do the following. If the None
means None
like you're specifying a fill value and the default is filling with None
values, when we use default None
. If None
means doesn't apply, don't do whatever... then we use optional
. For example, in the chunksize
, None
means do not chunk, not a chunk size, so that should be optional
. If you don't mind fixing those.
Also, when we specify list
, if it makes sense, better to use list of str
...
For the rest looks good. Thanks!
Issue has been opened. #27308 And the fixes to the type hints have been made. |
can you merge master |
Resolve merge conflict by accepting upstream changes.
Done. |
Thanks @mpmoran! |
…ide (pandas-dev#27280) * DOC: cleanup docstring for read_json and fix error in contribution guide
closes #xxxx
tests added / passed
passes
git diff upstream/master -u -- "*.py" | flake8 --diff
whatsnew entry
Contribution Guide
read_json()