Skip to content

Comments

fix: make multistorageclient import conditional in async_writer example#265

Merged
hexinw-nvidia merged 1 commit intoNVIDIA:mainfrom
ShreyaGupta08:fix/lazy-import-multistorageclient
Feb 19, 2026
Merged

fix: make multistorageclient import conditional in async_writer example#265
hexinw-nvidia merged 1 commit intoNVIDIA:mainfrom
ShreyaGupta08:fix/lazy-import-multistorageclient

Conversation

@ShreyaGupta08
Copy link
Contributor

The async_writer.py example unconditionally imports multistorageclient, which causes an immediate ImportError for users who don't have it installed — even when they're not using the --enable_msc flag.

This change makes the import conditional (try/except) and adds an explicit guard in main() that raises a clear error message only when --enable_msc is actually requested without the package installed.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 18, 2026

Greptile Summary

Wrapped the multistorageclient import in a try/except block and added a runtime check that raises a clear error message only when --enable_msc is used without the package installed.

  • Import is now conditional (sets msc = None on ImportError)
  • Guard added in main() to validate msc is available when --enable_msc flag is set
  • All existing usages of msc are already protected by if enable_msc checks
  • Follows existing codebase patterns for handling optional dependencies

Confidence Score: 5/5

  • This PR is safe to merge with no issues found
  • The change is simple, well-targeted, and follows established patterns in the codebase. All usages of msc are already protected by conditional checks, and the new guard ensures a clear error message is shown to users who need the package
  • No files require special attention

Important Files Changed

Filename Overview
examples/checkpointing/async_writer.py Made multistorageclient import conditional to prevent ImportError when package is not installed and --enable_msc flag is not used

Last reviewed commit: f063c89

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ShreyaGupta08 ShreyaGupta08 force-pushed the fix/lazy-import-multistorageclient branch from 1d75310 to 5243ba6 Compare February 18, 2026 00:38
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@hexinw-nvidia hexinw-nvidia added the ci-approved Approved to run CI label Feb 18, 2026
@ShreyaGupta08 ShreyaGupta08 removed the request for review from ankurv-nvidia February 18, 2026 17:02
@ShreyaGupta08 ShreyaGupta08 force-pushed the fix/lazy-import-multistorageclient branch from c927634 to df670db Compare February 19, 2026 00:16
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@hexinw-nvidia
Copy link
Contributor

@ShreyaGupta08 Please sign your commit. Thanks.
https://github.com/NVIDIA/nvidia-resiliency-ext/blob/main/CONTRIBUTING.md#signing-your-work

The async_writer.py example unconditionally imports multistorageclient,
which causes an immediate ImportError for users who don't have it
installed — even when they're not using the --enable_msc flag.

This change makes the import conditional (try/except) and adds an
explicit guard in main() that raises a clear error message only when
--enable_msc is actually requested without the package installed.
@ShreyaGupta08 ShreyaGupta08 force-pushed the fix/lazy-import-multistorageclient branch from df670db to f063c89 Compare February 19, 2026 17:20
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ShreyaGupta08
Copy link
Contributor Author

@hexinw-nvidia all the tests pass, can you merge the PR? I don't get an option to merge. Thanks!

@hexinw-nvidia hexinw-nvidia merged commit 8368e39 into NVIDIA:main Feb 19, 2026
9 checks passed
@ShreyaGupta08 ShreyaGupta08 deleted the fix/lazy-import-multistorageclient branch February 19, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved Approved to run CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants