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

test: xfail cuDF tests that use total_seconds #951

Conversation

LiamConnors
Copy link
Member

What type of PR is this? (check all applicable)

  • πŸ’Ύ Refactor
  • ✨ Feature
  • πŸ› Bug Fix
  • πŸ”§ Optimization
  • πŸ“ Documentation
  • βœ… Test
  • 🐳 Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below.

There are ten tests here currently failing because it looks like TimedeltaProperties in cuDF doesn't have a total_seconds and all these tests depend on it.

https://github.com/rapidsai/cudf/blob/branch-24.10/docs/cudf/source/user_guide/api_docs/series.rst#timedelta-properties
docs start here: https://docs.rapids.ai/api/cudf/stable/user_guide/api_docs/api/cudf.core.series.timedeltaproperties.days/

FAILED tests/expr_and_series/dt/datetime_duration_test.py::test_duration_attributes[cudf_constructor-total_minutes-expected_a0-expected_b0-expected_c0] - AttributeError: 'TimedeltaProperties' object has no attribute 'total_seconds'
FAILED tests/expr_and_series/dt/datetime_duration_test.py::test_duration_attributes[cudf_constructor-total_seconds-expected_a1-expected_b1-expected_c1] - AttributeError: 'TimedeltaProperties' object has no attribute 'total_seconds'
FAILED tests/expr_and_series/dt/datetime_duration_test.py::test_duration_attributes[cudf_constructor-total_milliseconds-expected_a2-expected_b2-expected_c2] - AttributeError: 'TimedeltaProperties' object has no attribute 'total_seconds'
FAILED tests/expr_and_series/dt/datetime_duration_test.py::test_duration_attributes[cudf_constructor-total_microseconds-expected_a3-expected_b3-expected_c3] - AttributeError: 'TimedeltaProperties' object has no attribute 'total_seconds'
FAILED tests/expr_and_series/dt/datetime_duration_test.py::test_duration_attributes[cudf_constructor-total_nanoseconds-expected_a4-expected_b4-expected_c4] - AttributeError: 'TimedeltaProperties' object has no attribute 'total_seconds'
FAILED tests/expr_and_series/dt/datetime_duration_test.py::test_duration_attributes_series[cudf_constructor-total_minutes-expected_a0-expected_b0-expected_c0] - AttributeError: 'TimedeltaProperties' object has no attribute 'total_seconds'
FAILED tests/expr_and_series/dt/datetime_duration_test.py::test_duration_attributes_series[cudf_constructor-total_seconds-expected_a1-expected_b1-expected_c1] - AttributeError: 'TimedeltaProperties' object has no attribute 'total_seconds'
FAILED tests/expr_and_series/dt/datetime_duration_test.py::test_duration_attributes_series[cudf_constructor-total_milliseconds-expected_a2-expected_b2-expected_c2] - AttributeError: 'TimedeltaProperties' object has no attribute 'total_seconds'
FAILED tests/expr_and_series/dt/datetime_duration_test.py::test_duration_attributes_series[cudf_constructor-total_microseconds-expected_a3-expected_b3-expected_c3] - AttributeError: 'TimedeltaProperties' object has no attribute 'total_seconds'
FAILED tests/expr_and_series/dt/datetime_duration_test.py::test_duration_attributes_series[cudf_constructor-total_nanoseconds-expected_a4-expected_b4-expected_c4] - AttributeError: 'TimedeltaProperties' object has no attribute 'total_seconds'

@MarcoGorelli do you think it would be a good idea to document these and any others that aren't currently supported. I was thinking that it might be helpful, but also that it may be hard to keep this info up to date. Though, I suppose when running the tests, it would be easy enough to see if any of these pass in the future.

@MarcoGorelli
Copy link
Member

thanks @LiamConnors ! πŸ™

for drop_first, I reported this to them and they reacted very quickly rapidsai/cudf#16795

I think it wouldn't hurt to add a docs note to some methods saying "not available in cudf", but .dt.total_seconds seems quite common...perhaps let's see if they respond to rapidsai/cudf#16802 ?

there's some unrelated CI failures, i'll try to get ci green, then we can merge

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.

unrelated ci failures are already being tracked, let's merge now then to reduce the queue - thanks @LiamConnors !

@MarcoGorelli MarcoGorelli merged commit 421d58b into narwhals-dev:main Sep 12, 2024
10 of 22 checks passed
@MarcoGorelli
Copy link
Member

@LiamConnors if it interests you, it might be possible to workaround cudf's limitation here by reimplementing total_seconds in terms of the other components?

@LiamConnors
Copy link
Member Author

thanks @MarcoGorelli. that sounds good to me! I'll take a look.

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

Successfully merging this pull request may close these issues.

2 participants