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

Intermittent CI failures with python 3.x/3.12 due to ForwardRef #3346

Open
stress-tess opened this issue Jun 18, 2024 · 5 comments
Open

Intermittent CI failures with python 3.x/3.12 due to ForwardRef #3346

stress-tess opened this issue Jun 18, 2024 · 5 comments

Comments

@stress-tess
Copy link
Member

Even after pinning the numpy version to <2.0 I'm still seeing CI failures:https://github.com/Bears-R-Us/arkouda/actions/runs/9572308279/attempts/1

It seems only the 3.x python version is affected. The python version was 3.12.4 with an error along the lines of

TypeError: type of argument "pda1" must be one of (pdarray, Strings, ForwardRef('Categorical'), Sequence); got arkouda.categorical.Categorical instead

So this appears to be a forward ref issue

The interesting bit is that python 3.12.0 didn't have this issue and python 3.12.4 was released on June 6th but we've had successful runs since then...

I think the most straightforward plan is to pin the python version as well until we can dig into it more

@stress-tess stress-tess self-assigned this Jun 18, 2024
@stress-tess
Copy link
Member Author

it seems rerunning the test worked? I'm going to leave this issue open since this doesn't seem like a one off kinda problem

@stress-tess
Copy link
Member Author

stress-tess commented Jun 19, 2024

I'm working on eliminating the ForwardRef since that seems to be the main source of the issue. This stackoverflow comment seems to give a much cleaner solution for avoiding circular imports

https://stackoverflow.com/questions/39740632/python-type-hinting-without-cyclic-imports

@stress-tess stress-tess changed the title CI failures with python 3.x Intermittent CI failures with python 3.x/3.12due to ForwardRef Jun 19, 2024
@stress-tess stress-tess changed the title Intermittent CI failures with python 3.x/3.12due to ForwardRef Intermittent CI failures with python 3.x/3.12 due to ForwardRef Jun 19, 2024
stress-tess added a commit that referenced this issue Jun 19, 2024
* pin python<3.12.4

* disable 3.12 and 3.x for the time being

---------

Co-authored-by: Tess Hayes <[email protected]>
@stress-tess
Copy link
Member Author

Testing locally this seems to only be breaking for python 3.12.4. I pinned python to be less than this and disabled the 3.12/3.x CI checks for this release until we can get to the bottom of this

stress-tess added a commit to stress-tess/arkouda that referenced this issue Aug 7, 2024
This PR (closes Bears-R-Us#3049) removes the upper bound of our `mypy` version since the latest works just fine. Also related to Bears-R-Us#3346, I changed the python restriction to be `!=3.12.4` since `3.12.3` works just fine. It seems version `3.12.5` was just released, so we'll have to see if the forward refs are still an issue
stress-tess added a commit to stress-tess/arkouda that referenced this issue Aug 7, 2024
This PR (closes Bears-R-Us#3049) removes the upper bound of our `mypy` version since the latest works just fine. Also related to Bears-R-Us#3346, I changed the python restriction to be `!=3.12.4` since `3.12.3` works just fine. It seems version `3.12.5` was just released, so we'll have to see if the forward refs are still an issue
github-merge-queue bot pushed a commit that referenced this issue Aug 8, 2024
This PR (closes #3049) removes the upper bound of our `mypy` version since the latest works just fine. Also related to #3346, I changed the python restriction to be `!=3.12.4` since `3.12.3` works just fine. It seems version `3.12.5` was just released, so we'll have to see if the forward refs are still an issue

Co-authored-by: Tess Hayes <[email protected]>
@stress-tess
Copy link
Member Author

stress-tess commented Aug 8, 2024

python 3.12.5 was released 2 days ago https://www.python.org/downloads/release/python-3125/

It seems to make some changes to how they handle ForwardRef in particular the __eq__ function:
https://docs.python.org/release/3.12.5/whatsnew/changelog.html#python-3-12-5

I'm hoping this will fix the problems we were having. It's not yet available through conda, but I'm impatient so I'm going to build from source

edit:
I was struggling to get this work and then they added it to conda forge while I was trying this out lol

@stress-tess
Copy link
Member Author

okay that didn't fix our problem, but I did find this:
https://typeguard.readthedocs.io/en/stable/userguide.html#permanently-suppressing-type-checks-for-selected-functions

indicating we needed to switch from @no_type_check to @typeguard_ignore, but that caused errors. I realized the version of typeguard is way behind. Updating that gives the following error:

TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'

This one is seen by others when moving from 3.12.3 to 3.12.4, so I feel like we're on the right track. It seems most other ppl are using pydantic so this was an upstream error for them

stress-tess added a commit to stress-tess/arkouda that referenced this issue Aug 28, 2024
This PR (Closes Bears-R-Us#3703) makes `3.12.3` the upper bound for python version because greater than this causes `ForwardRef` type errors. These will be worked in Bears-R-Us#3346. I also added a single dim registration file to `.configs` to make switching between states easier
github-merge-queue bot pushed a commit that referenced this issue Aug 28, 2024
This PR (Closes #3703) makes `3.12.3` the upper bound for python version because greater than this causes `ForwardRef` type errors. These will be worked in #3346. I also added a single dim registration file to `.configs` to make switching between states easier

Co-authored-by: Tess Hayes <[email protected]>
@stress-tess stress-tess removed their assignment Nov 13, 2024
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

1 participant