-
Notifications
You must be signed in to change notification settings - Fork 183
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
[BUG] An error occurred: <ContextVar name='context_contexts' at 0x17b9ea020> after upgrade to v1.0 #1578
Comments
I'm experiencing the same issue. Is there any update on this? |
Hey folks - @piotrm0 is currently working on a fix for this. As far as we can tell this issue is related to running in particular environments such as Google Colab or Snowflake Notebooks that have issues with support for python Context Variables, and does not occur locally. @sahil-sharma-50 @lorenzobalzani Are you using either Google Colab or Snowflake notebooks when you run into this issue? Can you move to a local environment while we wait on a fix? |
Hi, I’m currently running the package within a Streamlit application, but I’m not sure if it’s the root cause of the issue. However, we need to continue using Streamlit. |
Hi @lorenzobalzani , we are working on a fix for next release. For now, can you add this to your code before you import the rest of the trulens library: from trulens.core.feedback.endpoint import Endpoint
from trulens.core.instruments import WithInstrumentCallbacks
from contextvars import ContextVar
Endpoint._context_endpoints = ContextVar("endpoints", default={})
WithInstrumentCallbacks._context_contexts = ContextVar("context_contexts", default=set())
WithInstrumentCallbacks._stack_contexts = ContextVar("stack_contexts", default={}) |
I had to update the code listing above. |
Bug Description
An error occurred: <ContextVar name='context_contexts' at 0x14cd1fce0>
To Reproduce
The error happens in tru_wrapper, instruments.py:633.
Expected behavior
No error after migration.
Relevant Logs/Tracebacks
No errors besides the main one.
Environment:
Additional context
Before migrating to the new version no error was happening.
The text was updated successfully, but these errors were encountered: