Skip to content

Use f-strings in optuna/storages/journal/_storage.py#6440

Merged
not522 merged 3 commits intooptuna:masterfrom
edwiniac:fix/fstring-journal-storage
Feb 13, 2026
Merged

Use f-strings in optuna/storages/journal/_storage.py#6440
not522 merged 3 commits intooptuna:masterfrom
edwiniac:fix/fstring-journal-storage

Conversation

@edwiniac
Copy link
Copy Markdown
Contributor

Description

Addresses #6305

Converted direct .format() calls to f-strings in optuna/storages/journal/_storage.py.

Note: Left UNUPDATABLE_MSG.format() calls intact as they intentionally use a shared constant template.

Changes

  • Converted 3 direct .format() usages to f-strings
  • Used {var_name=} syntax where appropriate
  • Used !r for proper string quoting in user-facing messages

Checklist

  • One file only

edwiniac and others added 3 commits February 12, 2026 16:36
Addresses optuna#6305

Converted direct .format() calls to f-strings. Left UNUPDATABLE_MSG template-based formatting intact as it's intentionally using a shared constant.
@not522 not522 changed the title Use f-strings in optuna/storages/journal/_storage.py Use f-strings in optuna/storages/journal/_storage.py Feb 13, 2026
@not522 not522 added the code-fix Change that does not change the behavior, such as code refactoring. label Feb 13, 2026
@not522 not522 added this to the v4.8.0 milestone Feb 13, 2026
Copy link
Copy Markdown
Member

@not522 not522 left a comment

Choose a reason for hiding this comment

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

LGTM!
To minimize differences, I've removed !r.

@not522 not522 enabled auto-merge February 13, 2026 03:14
@not522 not522 merged commit 26ad3cd into optuna:master Feb 13, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-fix Change that does not change the behavior, such as code refactoring.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants