Repository navigation
Fix imports in the artifact tutorial Boto3ArtifactStore example - #6953
Merged
c-bata merged 1 commit intoNov 9, 2026
Merged
Conversation
The S3 pseudocode imported from optuna.artifact and optuna.artifact.boto3, which do not exist; upload_artifact, download_artifact and Boto3ArtifactStore are exported from optuna.artifacts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The S3 pseudocode in
tutorial/20_recipes/012_artifact_tutorial.pyimports fromoptuna.artifactandoptuna.artifact.boto3, and neither module exists, so anyone copying those import lines getsModuleNotFoundError: No module named 'optuna.artifact'. The two other code blocks in the same tutorial (lines 108-110 and 266-268) already import fromoptuna.artifacts.These broken imports were reported in #6860, where the maintainer review said they should be fixed in a separate PR. That PR was closed and I could not find a follow-up, so this is that separate fix, with credit to @bodapatisaikrishna for spotting it.
Description of the changes
Lines 184-186 of the tutorial now read:
All three names are exported from
optuna/artifacts/__init__.py(lines 2, 3 and 8, and__all__). Checked against the repo source on currentmaster(50c5b87), run from the repo root withuv run --no-project --with packaging --with numpy --with sqlalchemy --with alembic --with colorlog --with tqdm --with PyYAML python -c "<import>":No other line changes. The docs site was not built locally.
Checklist
This PR was prepared with AI assistance (Claude Code) and reviewed with GitHub Copilot.
🤖 Generated with Claude Code