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

Add tests with sliced dataframes #16

Open
jorisvandenbossche opened this issue Jan 10, 2023 · 2 comments
Open

Add tests with sliced dataframes #16

jorisvandenbossche opened this issue Jan 10, 2023 · 2 comments

Comments

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Jan 10, 2023

The spec has an offset property on the Column in case you need to take this into account about how to interpret the buffer (eg in case of slices). It would be good to add tests for this.

(for example, pandas currently ignores this)

@honno
Copy link
Member

honno commented Jan 10, 2023

Yeah, I'd hope at least we could manipulate columns with kinds of offset values for smoke testing. It's just manipulating offsets seems pretty tricky, as it requires a thorough understanding of how a given protocol adopter makes interchange dataframes/columns in the first place. My initial impression is I won't get around to this given the effort-to-reward.

@jorisvandenbossche
Copy link
Member Author

I am not sure we should be manipulating offsets of column objects ourselves (i.e. directly in the tests), as that would indeed get complicated. But this could also be covered in roundtrip tests. Basically, what I would expect is something like:

orig_df = ..
orig_df_sliced = slice_method(orig_df, 0, 2)
dest_df = dest_libinfo.from_dataframe(orig_df_sliced)
roundtrip_df = orig_libinfo.from_dataframe(dest_df)
assert orig_libinfo.frame_equal(roundtrip_df, orig_df)

so we probably only need a method on the LibraryInfo wrapper.py to slice a dataframe, and then run roundtrip tests with that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants