-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TST: Adds test coverage for pd.read_json index type #53242
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
pandas/tests/io/json/test_pandas.py
Outdated
df = DataFrame() | ||
dfjson = read_json("{}", orient=orient, convert_axes=True) | ||
|
||
assert df.index.dtype == dfjson.index.dtype |
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.
Could you compare the entire index?
dfjson = read_json("{}", orient=orient, convert_axes=True)
result = df.json.index
expected = df.index
tm.assert_index_equal(result, expected)
Same for the .columns
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 update with your suggestions shortly!
Updated with your suggestions @mroeschke |
Co-authored-by: Matthew Roeschke <[email protected]>
Updated with your latest suggestion @mroeschke. Let me know if there is anything else. |
Thanks @mcgeestocks |
* TST: Added test coverage for pd.read_json index type * Update pandas/tests/io/json/test_pandas.py Co-authored-by: Matthew Roeschke <[email protected]> * add coverage for entire index and columns. * Update pandas/tests/io/json/test_pandas.py Co-authored-by: Matthew Roeschke <[email protected]> --------- Co-authored-by: Matthew Roeschke <[email protected]>
* TST: Added test coverage for pd.read_json index type * Update pandas/tests/io/json/test_pandas.py Co-authored-by: Matthew Roeschke <[email protected]> * add coverage for entire index and columns. * Update pandas/tests/io/json/test_pandas.py Co-authored-by: Matthew Roeschke <[email protected]> --------- Co-authored-by: Matthew Roeschke <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Description:
@mroeschke mentioned that the merged fix for issue #28558 could use a test. This PR adds the missing test for index type equality between the
DataFrame
andread_json
functions.