Open lorenzobalzani opened 6 days ago
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?
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 Instrument
from contextvars import ContextVar
Endpoint._context_endpoints = ContextVar("endpoints", default={})
Instrument._context_contexts = ContextVar("context_contexts", default=set())
Instrument._stack_contexts = ContextVar("stack_contexts", default={})
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.