You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that pytask will check each symbol in a module while collecting tasks. One of the checks is whether something has a @task decorator and this function is responsible or, more importantly, this line.
Since _ probably overwrote __getattr__, it has all attributes, and so the protocol check will be true, and isclass(_) is False.
We need to find a way to guard pytask from these objects better.
from ibis import _ indeed overwrites __getattr__ and allows every attribute to be created like from pytask import mark.
In Python <= 3.11, any isinstance(_, PTask) check will return True because isinstance checks for protocols are imperfect and call getattr on _ which will yield an attribute.
In Python >= 3.12, the call was changed from hasattr to inspect.getattr_static and now the isinstance check returns Falselink
The issue in CPython https://github.com/python/cpython/issues/102433.
It is backported to typing_extensions, but I do not want to pin the package to >=4.6.0. lik: https://github.com/python/typing_extensions/pull/140.
Not sure if this is the exact root cause or not.
First,
pip install ibis-framework
.Then, in a task file have
from ibis import _
This results in
however, I tried to repro with putting this in the task file, and this does NOT error:
so not exactly sure the root cause.
The text was updated successfully, but these errors were encountered: