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

[BUG] LAZY_MODULES is populated with modules, not strings. #6046

Open
2 tasks done
patrick-kidger opened this issue Nov 23, 2024 · 1 comment
Open
2 tasks done

[BUG] LAZY_MODULES is populated with modules, not strings. #6046

patrick-kidger opened this issue Nov 23, 2024 · 1 comment
Labels
bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers

Comments

@patrick-kidger
Copy link

Describe the bug

On this line:

https://github.com/flyteorg/flytekit/blob/6f8b9a09c24b22553e249308abb36b14ff6a6876/flytekit/lazy_import/lazy_module.py#L21

Then module_name not in LAZY_MODULES will always return True as the list is populated with modules, not module names (i.e. strings).

That means that this check:

https://github.com/flyteorg/flytekit/blob/6f8b9a09c24b22553e249308abb36b14ff6a6876/flytekit/core/type_engine.py#L1264-L1266

will actually import all of pandas. This is slow.

Expected behavior

I think the check you probably want here instead is object.__getattribute__(module, "__class__") is not importlib.util._LazyModule.

Additional context to reproduce

No response

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@patrick-kidger patrick-kidger added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Nov 23, 2024
Copy link

welcome bot commented Nov 23, 2024

Thank you for opening your first issue here! 🛠

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers
Projects
Status: Backlog
Development

No branches or pull requests

1 participant