Skip to content

Commit

Permalink
Forward right parameters in LazyModule.
Browse files Browse the repository at this point in the history
Before this fix, `error_callback`/`success_callback` were not forwarded in some cases.

PiperOrigin-RevId: 523376761
  • Loading branch information
marcenacp authored and The TensorFlow Datasets Authors committed Apr 11, 2023
1 parent ec6c6f5 commit f12330a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tensorflow_datasets/core/utils/lazy_imports_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ def from_cache(cls, **kwargs):
def __getattr__(self, name: str) -> Any:
if name in self.fromlist:
module_name = f"{self.module_name}.{name}"
return self.from_cache(module_name=module_name)
return self.from_cache(
module_name=module_name,
module=self.module,
fromlist=self.fromlist,
error_callback=self.error_callback,
success_callback=self.success_callback,
)
if self.module is None: # Load on first call
try:
start_import_time = time.perf_counter()
Expand Down

0 comments on commit f12330a

Please sign in to comment.