Skip to content
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

feat: use importlib when deserializing callables #8648

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LastRemote
Copy link
Contributor

Related Issues

Proposed Changes:

Supports local package imports via importlib.import_module

How did you test it?

Existing unit tests passed. I also added a new negative test for this.

Notes for the reviewer

This is a rather small change but it is causing issues for me right now. Really hope this can be included in 2.9.0!

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added unit tests and updated the docstrings
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@LastRemote LastRemote requested review from a team as code owners December 17, 2024 07:31
@LastRemote LastRemote requested review from dfokina and anakin87 and removed request for a team December 17, 2024 07:31
@github-actions github-actions bot added topic:tests type:documentation Improvements on the docs labels Dec 17, 2024
streaming_callback = getattr(module, function_name, None)
if not streaming_callback:
try:
module = import_module(module_name, None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LastRemote Thanks for opening this PR! We merged a change related to this part of the code base yesterday. Could you please update it so that we also use a thread safe import here too? 91619a7#diff-3a452f86d110b4f40389e0e4551b372188b5fe158aafe0afd5226d0007820457R139
We'll get back to you with a full review next week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:tests type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deserialize_callable is not working for local files
2 participants