Skip to content

DOC: pandas.json_normalize missing from API Reference portion of documentation #42540

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

Closed
TimelikeClosure opened this issue Jul 14, 2021 · 5 comments · Fixed by #44531
Closed
Labels
Docs IO JSON read_json, to_json, json_normalize
Milestone

Comments

@TimelikeClosure
Copy link

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.json_normalize.html (currently responds with a 404 Not Found)

Documentation problem

While the source code does contain API reference documentation for pandas.json_normalize (previously pandas.io.json.json_normalize) as seen in /pandas/io/json/_normalize.py, it isn't available in the documentation for the current version of pandas hosted on pandas.pydata.org.

Suggested fix for documentation

At least one older version of pandas does have documentation that includes a json_normalize API reference under its old name (pandas.io.json.json_normalize in v0.25.0), so it seems feasible that it was removed by accident when its old name was deprecated in v1.0.0. Attempting to visit pandas.io.json.json_normalize in the current version of the documentation redirects to the new name (pandas.json_normalize), which responds with a 404.

@TimelikeClosure TimelikeClosure added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Jul 14, 2021
@rhshadrach rhshadrach added the IO JSON read_json, to_json, json_normalize label Jul 18, 2021
@rhshadrach
Copy link
Member

rhshadrach commented Jul 18, 2021

Edit: This comment is incorrect, within pandas.__init__ is the line:

from pandas.io.json import _json_normalize as json_normalize

Thanks for the report! The method referenced is _json_normalize, the leading underscore indicating that is is internal and not meant for users.

@mroeschke mroeschke removed the Needs Triage Issue that has not been reviewed by a pandas team member label Aug 21, 2021
@tilusnet
Copy link

Pandas 1.2.5 still had the API documentation available: https://pandas.pydata.org/pandas-docs/version/1.2.5/reference/api/pandas.json_normalize.html

Yet the latest version still has json_normalize documented in the User Guide section: https://pandas.pydata.org/docs/user_guide/io.html#normalization

The missing API entry is surely a mistake then?

@haakenlid
Copy link

Thanks for the report! The method referenced is _json_normalize, the leading underscore indicating that is is internal and not meant for users.

It's exposed as pandas.json_normalize in the top level namespace, and it certainly is meant for users.

https://github.com/pandas-dev/pandas/blob/master/pandas/__init__.py#L170

@haakenlid
Copy link

Here's a commit removing it from the docs, claiming it's deprecated.

47f90ed

I can't find any explanation of what that is supposed to mean.

@rhshadrach
Copy link
Member

Thanks for following up on this @haakenlid - my comment above was incorrect (and is now edited). In 1.0.0 pandas.io.json_normalize was deprecated in favor of pandas.json_normalize

https://pandas.pydata.org/pandas-docs/version/1.0.0/whatsnew/v1.0.0.html#deprecations
#27615

So the commit you found was right in that it should be removed from io, but it needs to be added to the docs from pandas namespace. A PR to fix this is most welcome!

@rhshadrach rhshadrach added this to the Contributions Welcome milestone Sep 10, 2021
@simonjayhawkins simonjayhawkins modified the milestones: Contributions Welcome, 1.3.5 Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs IO JSON read_json, to_json, json_normalize
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants