-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix tracing hierarchy for imperative api #3036
Conversation
Pretty simple fix. Wish I could forget the |
@@ -148,9 +150,12 @@ def call( | |||
input: Any, | |||
*, | |||
retry: Optional[RetryPolicy] = None, | |||
callbacks: Optional[Callbacks] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Callbacks is already wrapped in an Optional in langchain_core
task = self.executor.submit(next_tick, fn, *args, **kwargs) | ||
task = cast( | ||
concurrent.futures.Future[T], | ||
self.executor.submit(next_tick, ctx.run, fn, *args, **kwargs), # type: ignore[arg-type] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: next_tick
is a bit confusing on the sync side -- sleep(0) isn't guaranteed to context switch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the closest equivalent. And yes it does context switch https://stackoverflow.com/a/7273727
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also not something being changed in this PR?
No description provided.