Skip to content

Fix TC006 cast annotation in optuna.trial._frozen - #6529

Merged
c-bata merged 1 commit into
optuna:masterfrom
t7r0n:fix/type-checking-trial-frozen-6029
Mar 23, 2026
Merged

c-bata merged 1 commit into
optuna:masterfrom
t7r0n:fix/type-checking-trial-frozen-6029

Conversation

@t7r0n

@t7r0n t7r0n commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Motivation

Part of #6029.

ruff check --select TCH reports TC006 in optuna/trial/_frozen.py.

What I changed

  • Replaced cast(dict[str, Any], ...) with cast("dict[str, Any]", ...) in optuna/trial/_frozen.py.

This is a type-annotation-only change and does not modify runtime behavior.

Validation

ruff check optuna/trial/_frozen.py --select TCH
ruff check optuna/trial/_frozen.py
ruff format --check optuna/trial/_frozen.py
mypy optuna/trial/_frozen.py
pytest tests/trial_tests/test_frozen.py -q

All commands passed locally.

@t7r0n
t7r0n force-pushed the fix/type-checking-trial-frozen-6029 branch from dceb315 to a89f13e Compare March 20, 2026 19:00
@c-bata c-bata added the code-fix Change that does not change the behavior, such as code refactoring. label Mar 23, 2026
@c-bata c-bata added this to the v4.9.0 milestone Mar 23, 2026
@c-bata
c-bata merged commit f52e7b0 into optuna:master Mar 23, 2026
12 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