-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Allow CallsiteParameterAdder to be pickled #603
Allow CallsiteParameterAdder to be pickled #603
Conversation
Prior to this commit, the `CallsiteParameterAdder` object could not be pickled. As a result, structlog configurations could not be propagated to subprocesses using `pickle.dumps(structlog.get_config())`. This commit updates the handlers in `CallsiteParameterAdder._handlers` to be free functions, rather than lambda functions, so that all class members can be pickled. Closes hynek#600
for more information, see https://pre-commit.ci
Required for compatibility with TVM PR apache/tvm#16618. Can be removed after upstream `structlog` hynek/structlog#603 lands. This is a backport of the OLLM PR octoml/ollm#409, and is not needed after the MLC-serve migration.
Required for compatibility with TVM PR apache/tvm#16618. Can be removed after upstream `structlog` hynek/structlog#603 lands. This is a backport of the OLLM PR octoml/ollm#409, and is not needed after the MLC-serve migration.
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.
Can you make the function names verbs please? (iow: _pathname
→ _get_pathname
).
Changelog entry would be great too ("structlog.processors.CallsiteParameterAdder
is now pickleable." + link here).
(oh and get the CI green too, pls 😇 – I think it's just missing type hints for the functions?)
Can do. I've updated each function name from
And updated. (Made the commit for the changelog yesterday, but forgot to push it.)
Thank you on pointing me in the right direction. Updated the signatures from |
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.
Great, thanks!
Summary
Prior to this commit, the
CallsiteParameterAdder
object could not be pickled. As a result, structlog configurations could not be propagated to subprocesses usingpickle.dumps(structlog.get_config())
. This commit updates the handlers inCallsiteParameterAdder._handlers
to be free functions, rather than lambda functions, so that all class members can be pickled.Closes #600
Pull Request Check List
main
branch – use a separate branch!api.py
.docs/api.rst
by hand.versionadded
,versionchanged
, ordeprecated
directives..rst
and.md
files is written using semantic newlines.