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 compatibility for pandas 2 #1184

Merged
merged 20 commits into from
Jun 30, 2023

Conversation

charlesbluca
Copy link
Collaborator

Looks like the upstream constraints on pandas in our CI environment have been removed such that we're now pulling in pandas 2, which is raising some new errors.

Noting that after unblocking these failures, we should probably explore a combination of upstream testing for pandas along with erroring on certain warnings in our Python tests, which should allow us to more gradually follow these breaking changes as their introduced (IIUC this is the approach that Dask/Distributed take).

@charlesbluca charlesbluca marked this pull request as draft June 20, 2023 16:19
Comment on lines 172 to 178
if cudf:
# cudf doesn't have support for timezoned datetime data
df = datetime_table.copy()
df["timezone"] = df["timezone"].dt.tz_localize(None)
df["utc_timezone"] = df["utc_timezone"].dt.tz_localize(None)
return cudf.from_pandas(df)
return None
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Before this change, we were actually overwriting the datetime_table CPU fixture such that it didn't contain timezone-aware data.

Now that we're no longer doing that, a failure has been exposed in test_filter_cast_timestamp because filtering a timezone-aware column by a timestamp would require non-UTC timezone handling for literals on the Python end:

if timezone and timezone != "UTC":
raise ValueError("Non UTC timezones not supported")

There are a few ways we could handle this, but all of them generally involve front-facing changes to timestamp literal handling so figure it might make sense to break that off into a separate PR.

Okay with xfailing that test for now to get this in? cc @ayushdg @jdye64

@charlesbluca charlesbluca marked this pull request as ready for review June 21, 2023 16:35
@codecov-commenter
Copy link

codecov-commenter commented Jun 22, 2023

Codecov Report

Merging #1184 (f4b25a0) into main (5421bbf) will increase coverage by 0.23%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main    #1184      +/-   ##
==========================================
+ Coverage   81.72%   81.95%   +0.23%     
==========================================
  Files          78       78              
  Lines        4519     4539      +20     
  Branches      831      837       +6     
==========================================
+ Hits         3693     3720      +27     
+ Misses        643      633      -10     
- Partials      183      186       +3     
Impacted Files Coverage Δ
dask_sql/_compat.py 100.00% <100.00%> (ø)
dask_sql/mappings.py 80.59% <100.00%> (+0.90%) ⬆️
dask_sql/physical/rel/custom/analyze_table.py 88.00% <100.00%> (-1.29%) ⬇️
dask_sql/physical/rex/core/call.py 89.25% <100.00%> (ø)
dask_sql/server/presto_jdbc.py 88.67% <100.00%> (ø)

... and 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@ayushdg ayushdg left a comment

Choose a reason for hiding this comment

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

Minor suggestions but nothing blocking for the merge.

tests/integration/fixtures.py Outdated Show resolved Hide resolved
tests/integration/test_filter.py Outdated Show resolved Hide resolved
@charlesbluca charlesbluca merged commit 371315c into dask-contrib:main Jun 30, 2023
25 checks passed
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

Successfully merging this pull request may close these issues.

None yet

3 participants