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
dataclasses.FrozenInstanceError: cannot assign to field '__traceback__'
…using pint 0.21 and dask 2023.4.0 together. The exception is actually thrown from within contextlib:
File "/home/khaeru/vc/genno/genno/core/computer.py", line 499, in get
result = dask_get(dsk, key)
^^^^^^^^^^^^^^^^^^
File "/home/khaeru/.venv/3.11/lib/python3.11/site-packages/dask/local.py", line 557, in get_sync
return get_async(
^^^^^^^^^^
File "/home/khaeru/.venv/3.11/lib/python3.11/site-packages/dask/local.py", line 425, in get_async
with local_callbacks(callbacks) as callbacks:
File "/usr/lib/python3.11/contextlib.py", line 189, in __exit__
exc.__traceback__ = traceback
^^^^^^^^^^^^^^^^^
File "<string>", line 4, in __setattr__
I see that 08b9807 set @dataclass(frozen=False) in several places in pint.errors with the commit message "Using frozen=False in errors to avoid problems with dask". Upon some digging, I discovered the offending class in my case was actually this one:
I like frozen dataclasses. It makes things easier to reason around. But it seems that exceptions cannot be frozen in dask. I was wonder what would happen if we add a traceback get/set property and use this to change its value.
I just ran into a cryptic:
…using pint 0.21 and dask 2023.4.0 together. The exception is actually thrown from within contextlib:
I see that 08b9807 set
@dataclass(frozen=False)
in several places in pint.errors with the commit message "Using frozen=False in errors to avoid problems with dask". Upon some digging, I discovered the offending class in my case was actually this one:pint/pint/delegates/txt_defparser/common.py
Lines 21 to 22 in dd89fb8
This appears to have been missed in the earlier commit.
The text was updated successfully, but these errors were encountered: