Open patrick-kidger opened 6 days ago
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).
module_name not in LAZY_MODULES
True
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.
I think the check you probably want here instead is object.__getattribute__(module, "__class__") is not importlib.util._LazyModule.
object.__getattribute__(module, "__class__") is not importlib.util._LazyModule
No response
Thank you for opening your first issue here! ðŸ›
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 returnTrue
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?
Have you read the Code of Conduct?