Skip to content

Json parametrize more2 #33163

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

Merged
merged 5 commits into from
Mar 31, 2020
Merged

Conversation

WillAyd
Copy link
Member

@WillAyd WillAyd commented Mar 31, 2020

No description provided.

@pep8speaks
Copy link

pep8speaks commented Mar 31, 2020

Hello @WillAyd! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-03-31 03:24:44 UTC

@WillAyd WillAyd added IO JSON read_json, to_json, json_normalize Testing pandas testing functions or related to the test suite labels Mar 31, 2020
with tm.ensure_clean("test.json") as path:
for df in [
float_frame,
self.intframe,
self.tsframe,
self.mixed_frame,
Copy link
Member Author

Choose a reason for hiding this comment

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

I just removed mixed_frame here as this is its only use in the module; doesn't seem important to re-create, and in its current state it was really the same thing as float_frame anyway

@jbrockmendel
Copy link
Member

LGTM

Copy link
Member

@jschendel jschendel left a comment

Choose a reason for hiding this comment

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

lgtm, one small comment

"""
df = DataFrame({k: v.astype(int) for k, v in tm.getSeriesData().items()})
# force these all to int64 to avoid platform testing issues
return DataFrame({c: s for c, s in df.items()}, dtype=np.int64)
Copy link
Member

Choose a reason for hiding this comment

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

I think this could be done more directly as:

return DataFrame(tm.getSeriesData()).astype("int64")

I realize this was just moved as-is so could maybe wait for a follow-up but since the diff is relatively small I don't think it'd hurt to simplify while we're here.

Copy link
Member Author

Choose a reason for hiding this comment

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

yea I agree - nice catch!

Copy link
Member

Choose a reason for hiding this comment

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

i assumed this had to do with the uniqueness mentioned in the docstring

@jreback jreback added this to the 1.1 milestone Mar 31, 2020
Fixture for DataFrame of floats with DatetimeIndex

Columns are ['A', 'B', 'C', 'D']

Copy link
Contributor

Choose a reason for hiding this comment

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

doesn't this duplicate some existing fixtures?

@@ -526,6 +526,64 @@ def empty_frame():
return DataFrame()


@pytest.fixture
def int_frame():
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

does this duplicate?

@WillAyd
Copy link
Member Author

WillAyd commented Mar 31, 2020

@jreback no to both comments - these are the only fixtures with those names

@jreback
Copy link
Contributor

jreback commented Mar 31, 2020

@jreback no to both comments - these are the only fixtures with those names

kk

@jreback jreback merged commit 4d0eef6 into pandas-dev:master Mar 31, 2020
@WillAyd WillAyd deleted the json-parametrize-more2 branch April 12, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO JSON read_json, to_json, json_normalize Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants