Skip to content

Python 3.14 compat#5493

Merged
DanilaFe merged 4 commits into
Bears-R-Us:mainfrom
DanilaFe:python-3.14-compat
May 19, 2026
Merged

Python 3.14 compat#5493
DanilaFe merged 4 commits into
Bears-R-Us:mainfrom
DanilaFe:python-3.14-compat

Conversation

@DanilaFe
Copy link
Copy Markdown
Contributor

@DanilaFe DanilaFe commented May 18, 2026

The individual commits describe the changes pretty well.

  • A test was using the expected stringification of union types into typing.Union. In Python 3.14, seems like this was switched to just | for disjunction. Instead of relying on strings, add a new helper that explicitly interrogates a type to ensure it's a union with the right elements.
  • A Python test was generating a set of random strings that are numeric. Python 3.14 updates to a newer Unicode, with more numeric characters. Arkouda's own unicode tables do not include those, so the test, which expected Arkouda to concur that strings that Python considers numeric are, indeed, numeric, fails. To fix, update the Unicode tables to match Python 3.14's. This is a purely additive change, and is therefore backwards compatible: strings consider by Python 3.13 to be numeric are still numeric, and strings that AREN'T numeric are made from inserting alphabetic characters, which are still not numeric. Also, add a script based on chapel.replace to auto-generate new Unicode numeric tables using Python as reference. I used this script for this change.
  • chplcheck 2.8 included a new UnattachedCurly rule that enforces curly braces on the same line as if/else. This failed 9 times and only in one file, so I updated the file to match the conventions of the rest of Arkouda.

Reviewed by @jabraham17 -- thanks!

DanilaFe added 4 commits May 18, 2026 14:52
This avoids breakage with Python 3.14 which changes the string
representation of unions from `typing.Union[a,b]` to `a | b`.

Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Also adds a script for re-generating update_numeric_unicodes.py

Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
@DanilaFe DanilaFe force-pushed the python-3.14-compat branch from 23c17cd to 5af16f3 Compare May 19, 2026 00:59
@DanilaFe DanilaFe marked this pull request as ready for review May 19, 2026 15:58
@DanilaFe DanilaFe force-pushed the python-3.14-compat branch from 5af16f3 to 664f91a Compare May 19, 2026 16:37
@DanilaFe DanilaFe enabled auto-merge May 19, 2026 16:47
@DanilaFe DanilaFe added this pull request to the merge queue May 19, 2026
Merged via the queue into Bears-R-Us:main with commit 34c93fd May 19, 2026
19 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.

2 participants