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

TST: Interchange implementation for timestamp[ns][pyarrow] #57026

Merged
merged 4 commits into from
Jan 29, 2024

Conversation

aidoskanapyanov
Copy link
Contributor

@MarcoGorelli MarcoGorelli self-requested a review January 23, 2024 18:19
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

thanks for your PR!

Comment on lines 303 to 304
result["col0"] = result["col0"].astype("timestamp[ns][pyarrow]")
tm.assert_frame_equal(df, result)
Copy link
Member

Choose a reason for hiding this comment

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

can we check the result explicitly please?

like

result = pd.api.interchange.from_dataframe(dfi)['col0'].item()
expected = pd.Timestamp(...)
assert result == expected

, fill in Timestamp

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

this is failing CI

FAILED pandas/tests/interchange/test_impl.py::test_timestamp_ns_pyarrow - NameError: name 'pa' is not defined

@aidoskanapyanov
Copy link
Contributor Author

Hi, thanks for pointing out, I added the necessary pytest.importorskip to prevent the test from failing.

@MarcoGorelli MarcoGorelli added this to the 3.0 milestone Jan 29, 2024
@MarcoGorelli MarcoGorelli added the Interchange Dataframe Interchange Protocol label Jan 29, 2024
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

thanks @aidoskanapyanov (CI failure is unrelated)

@MarcoGorelli MarcoGorelli merged commit 56b5979 into pandas-dev:main Jan 29, 2024
52 of 54 checks passed
@aidoskanapyanov aidoskanapyanov deleted the i-56712 branch March 18, 2024 13:18
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
…v#57026)

* TST: Interchange implementation for timestamp[ns][pyarrow]

* Check timestamp explicitly

* Use pytest.importorskip

---------

Co-authored-by: Marco Edward Gorelli <marcogorelli@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interchange Dataframe Interchange Protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Interchange protocol implementation does not handle timestamp[ns][pyarrow] type correctly
2 participants