Skip to content

Commit

Permalink
Prevent LazyLoader loading module when repr is called on module (#…
Browse files Browse the repository at this point in the history
…10494)

Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
  • Loading branch information
WeichenXu123 committed Nov 27, 2023
1 parent 34c5bc2 commit 7dfbd2a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mlflow/utils/lazy_load.py
Expand Up @@ -44,3 +44,8 @@ def __getattr__(self, item):
def __dir__(self):
module = self._load()
return dir(module)

def __repr__(self):
if not self._module:
return f"<module '{self.__name__} (Not loaded yet)'>"
return repr(self._module)

0 comments on commit 7dfbd2a

Please sign in to comment.