Skip to content

Prevent pydap (dap4) to change string arrays to unicode type (testing). Fixed upstream #10482

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 8 commits into from
Jul 2, 2025

Conversation

Mikejmnez
Copy link
Contributor

@Mikejmnez Mikejmnez commented Jul 1, 2025

  • Partially addresses issues ⚠️ Nightly upstream-dev CI failed ⚠️ #10261 (at least those regarding pydap backend).
  • Tests added now pass on both min-dependencies environment (pydap 3.5.0 which has numpy<2) and with python=3.12 (nightly?)
  • User visible changes (including notable bug fixes) are documented in whats-new.rst

@github-actions github-actions bot added topic-documentation CI Continuous Integration tools dependencies Pull requests that update a dependency file labels Jul 1, 2025
@Mikejmnez Mikejmnez changed the title Pydap unicode Prevent pydap (dap4) to change string arrays to unicode type (testing). Fixed upstream Jul 1, 2025
@dcherian
Copy link
Contributor

dcherian commented Jul 1, 2025

Nice
Thank you!

# pydap <3.5.6 converts to unicode dtype=|U. Not what
# xarray expects. Thus force to bytes dtype. pydap >=3.5.6
# does not convert to unicode. https://github.com/pydap/pydap/issues/510
actual["bears"].values = actual["bears"].values.astype("S")
Copy link
Contributor

Choose a reason for hiding this comment

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

Just so I understand: pydap is changing behaviour and we are enforcing that new behaviour always?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's my understanding, too.

Copy link
Contributor Author

@Mikejmnez Mikejmnez Jul 2, 2025

Choose a reason for hiding this comment

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

Yes, sort of... It was more like pydap was always enforcing a change from "S" --> "U", which was not jiving with xarray. Beginning with the new version it will no longer enforce the change to unicode. Once the minimal pydap version moves up from 3.5.0 --> 3.5.6 this line won't be necessary.

Copy link
Contributor

@kmuehlbauer kmuehlbauer left a comment

Choose a reason for hiding this comment

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

Would be good to get this in soon, Numpy 2.3.1 is out (on conda-forge since yesterday) and it fails already on main.

@dcherian dcherian merged commit cb3ad04 into pydata:main Jul 2, 2025
24 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration tools dependencies Pull requests that update a dependency file topic-documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants