Skip to content

Move json_normalize to pd namespace #27586

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
WillAyd opened this issue Jul 25, 2019 · 6 comments · Fixed by #27615
Closed

Move json_normalize to pd namespace #27586

WillAyd opened this issue Jul 25, 2019 · 6 comments · Fixed by #27615
Labels
API Design good first issue IO JSON read_json, to_json, json_normalize

Comments

@WillAyd
Copy link
Member

WillAyd commented Jul 25, 2019

This function I think gets a good amount of usage but people tend to import from pandas.io.json. ref #27522 I think we should move this to the top level

cc @bhavaniravi

@WillAyd WillAyd added API Design IO JSON read_json, to_json, json_normalize good first issue labels Jul 25, 2019
@WillAyd WillAyd added this to the Contributions Welcome milestone Jul 25, 2019
@bhavaniravi
Copy link
Contributor

I totally agree.

@vishwakftw
Copy link
Contributor

I'd like to contribute to this patch. If I understand correctly, I'll have to import json_normalize in __init__.py, right?

Are there any additional warnings (future / deprecation) that need to be added for this change?

@WillAyd
Copy link
Member Author

WillAyd commented Jul 26, 2019

Start with that and a whatsnew. We may also want to throw a FutureWarning when someone tries importing from pandas.io.json; not sure best way to do that so can maybe just submit first part and we can discuss from there

@jorisvandenbossche
Copy link
Member

We may also want to throw a FutureWarning when someone tries importing from pandas.io.json

Is this needed? We have always consistently documented it to be imported from there (and we also have other public functionality in that submodule), so this just gives code churn for not much reason I think.

Of course for json_normalize, the argument can be that it is used often enough to warrant a top-level entry (I can't really judge that), and keeping it in two locations is also confusing, so that would be an argument to deprecate the other.

There is also pd.io.json.build_table_schema which ideally lives in the same place, but I am not sure this warrants a top-level function as well.

(see also the comment I made in #27522 about json_normalize being far from the only public non-top-level function, although it might be the most used one, I don't know)

@amcnulty93
Copy link

Is this still being worked on? If not I can pick it up!

@vishwakftw
Copy link
Contributor

It is being worked on in #27615.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design good first issue IO JSON read_json, to_json, json_normalize
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants