Skip to content
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

DEPR: Deprecate literal json string input to read_json #53409

Merged
merged 36 commits into from
Jun 20, 2023
Merged

DEPR: Deprecate literal json string input to read_json #53409

merged 36 commits into from
Jun 20, 2023

Conversation

rmhowe425
Copy link
Contributor

@rmhowe425 rmhowe425 commented May 27, 2023

@rmhowe425 rmhowe425 marked this pull request as draft May 27, 2023 01:15
@rmhowe425 rmhowe425 changed the title ENH: Deprecate literal json string input to read_json DEP: Deprecate literal json string input to read_json May 27, 2023
@rmhowe425 rmhowe425 marked this pull request as ready for review May 27, 2023 23:16
@rmhowe425
Copy link
Contributor Author

rmhowe425 commented May 27, 2023

Code Checks / Docstring validation, typing, and other manual pre-commit hooks (pull_request) test failing seems to be unrelated to changes in my PR.

Doc Build and Upload seems to be failing because the CI test itself passes literal JSON strings to read_json. This doesn't seem like something that I can fix myself?

@rmhowe425 rmhowe425 changed the title DEP: Deprecate literal json string input to read_json DEPR: Deprecate literal json string input to read_json May 27, 2023
@rmhowe425
Copy link
Contributor Author

@mroeschke Would you be able to take a look at this PR and let me know if anything needs updating?

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change the existing tests by wrapping them in StringIO?

@mroeschke mroeschke added IO JSON read_json, to_json, json_normalize Deprecate Functionality to remove in pandas labels May 30, 2023
@rmhowe425 rmhowe425 requested a review from mroeschke May 31, 2023 03:04
@rmhowe425
Copy link
Contributor Author

@mroeschke This PR should be ready for review!

@rmhowe425 rmhowe425 requested a review from mroeschke June 12, 2023 22:54
@rmhowe425
Copy link
Contributor Author

rmhowe425 commented Jun 12, 2023

@mroeschke Should be good to go now.

@mroeschke
Copy link
Member

Looks like some of the code checks are still failing in the CI

@rmhowe425
Copy link
Contributor Author

@mroeschke Code Checks / Docstring validation passing now. Docbuild and upload test failure doesn't appear to be associated with PR

@mroeschke
Copy link
Member

You may want to check usage of read_json in the the doc/source folder for the deprecated behavor. PRs should still pass the doc build

@rmhowe425
Copy link
Contributor Author

@mroeschke Pinging on green!

@rmhowe425
Copy link
Contributor Author

@mroeschke Should be good to go now!

@mroeschke mroeschke added this to the 2.1 milestone Jun 20, 2023
@mroeschke mroeschke merged commit 5f4dcdf into pandas-dev:main Jun 20, 2023
@mroeschke
Copy link
Member

Thanks @rmhowe425

canthonyscott pushed a commit to canthonyscott/pandas-anthony that referenced this pull request Jun 23, 2023
)

* Adding logic to throw a deprecation warning when a literal json string is passed to read_json

* Adding logic to throw a deprecation warning when a literal json string is passed to read_json

* Updating documentation and adding PR num to unit test

* Adding a deprecation warning to the user guide

* Updating unit tests to check for FutureWarning

* Fixing unit tests

* Fixing unit tests

* Fixing unit tests

* Fixing unit tests

* Fixing documentation errors in PR feedback

* Fixing documentation errors in PR feedback

* Updating unit tests to use StringIO rather than catch FutureWarning

* Finishing updating unit tests to use StringIO rather than catch FutureWarning

* Fixing indendation errors in unit tests. Moved one unit test to another file.

* Updating unit test name

* Adding additional checks to unit tests

* Fixing unit tests

* Fixing unit tests

* Updating whatsnew documentation per reviewer recommendations.

* Fixing failing code tests

* Fixing failing code tests

* Adding import to doc string example

* Fixing documentation formatting error

* Fixing documentation formatting error

* Fixing documentation error after fixing merge conflict

* Fixing formatting errors in whatsnew file

* Updating formatting errors in documentation

* Updating formatting errors in documentation
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
)

* Adding logic to throw a deprecation warning when a literal json string is passed to read_json

* Adding logic to throw a deprecation warning when a literal json string is passed to read_json

* Updating documentation and adding PR num to unit test

* Adding a deprecation warning to the user guide

* Updating unit tests to check for FutureWarning

* Fixing unit tests

* Fixing unit tests

* Fixing unit tests

* Fixing unit tests

* Fixing documentation errors in PR feedback

* Fixing documentation errors in PR feedback

* Updating unit tests to use StringIO rather than catch FutureWarning

* Finishing updating unit tests to use StringIO rather than catch FutureWarning

* Fixing indendation errors in unit tests. Moved one unit test to another file.

* Updating unit test name

* Adding additional checks to unit tests

* Fixing unit tests

* Fixing unit tests

* Updating whatsnew documentation per reviewer recommendations.

* Fixing failing code tests

* Fixing failing code tests

* Adding import to doc string example

* Fixing documentation formatting error

* Fixing documentation formatting error

* Fixing documentation error after fixing merge conflict

* Fixing formatting errors in whatsnew file

* Updating formatting errors in documentation

* Updating formatting errors in documentation
galipremsagar added a commit to rapidsai/cudf that referenced this pull request Dec 13, 2023
This PR deprecates reading literal strings in read_json, instead users will need to pass StringIO for these cases to silence the warning.

This change is to match: pandas-dev/pandas#53409

On pandas_2.0_feature_branch:

= 501 failed, 101106 passed, 2071 skipped, 786 xfailed, 312 xpassed, 20 errors in 1234.91s (0:20:34) =
This PR:

= 426 failed, 101181 passed, 2091 skipped, 786 xfailed, 312 xpassed in 1126.93s (0:18:46) =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas IO JSON read_json, to_json, json_normalize
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: Deprecate literal json string input to read_json
2 participants