Created
January 14, 2026 11:08
-
-
Save huksley/aa5bf9420ab101e96294877fc8bcf4f9 to your computer and use it in GitHub Desktop.
Disable LazyImport magic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/sky/adaptors/common.py b/sky/adaptors/common.py | |
| index 38c24ad4f..ceffb1fd3 100644 | |
| --- a/sky/adaptors/common.py | |
| +++ b/sky/adaptors/common.py | |
| @@ -59,18 +59,6 @@ class LazyImport(types.ModuleType): | |
| except AttributeError: | |
| # Dynamically create a new LazyImport instance for the submodule | |
| submodule_name = f'{self._module_name}.{name}' | |
| - try: | |
| - # Check if the submodule exists | |
| - if importlib_util.find_spec(submodule_name) is None: | |
| - raise AttributeError( # pylint: disable=raise-missing-from | |
| - f'Module {self._module_name} has no attribute {name}') | |
| - except (ValueError, ImportError): | |
| - # find_spec raises ValueError if the name is invalid | |
| - # (e.g. contains dots) or ImportError | |
| - raise AttributeError( | |
| - f'Module {self._module_name} has no attribute {name}' | |
| - ) from None | |
| - | |
| lazy_submodule = LazyImport(submodule_name, | |
| self._import_error_message) | |
| setattr(self, name, lazy_submodule) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With this removed, we get
TypeError: 'LazyImport' object is not callablegit clone https://github.com/huksley/skypilot/ sky
cd sky
git checkout feat-verda-cloud
Reverse LazyImport bug fix
curl -o LazyImport.patch https://gist.githubusercontent.com/huksley/aa5bf9420ab101e96294877fc8bcf4f9/raw/b3868efe7bd6a4cda7fa5ebab23406067089c597/LazyImport.patch
patch -p1 < LazyImport.patch