Skip to content

Remove set_system_attr and system_attrs from Study and Trial - #6834

Merged
c-bata merged 2 commits into
optuna:masterfrom
not522:remove-system-attr
Aug 31, 2026
Merged

c-bata merged 2 commits into
optuna:masterfrom
not522:remove-system-attr

Conversation

@not522

@not522 not522 commented Aug 28, 2026

Copy link
Copy Markdown
Member

Motivation

set_system_attr and system_attrs are deprecated in v3.1.0 and the removal is scheduled for v5.0.0.
FrozenTrial requires a data container with system_attrs, so we will only remove set_system_attr.

Description of the changes

  • Remove set_system_attr from Study, BaseTrial, FixedTrial, FrozenTrial, and Trial
  • Remove system_attrs from Study, BaseTrial, and Trial
  • Fix tests

Checklist

  • I used an LLM while working on this PR.

@not522 not522 added this to the v5.0.0 milestone Aug 28, 2026
@not522 not522 added the compatibility Change that breaks compatibility. label Aug 28, 2026
@not522
not522 force-pushed the remove-system-attr branch from 81cda2c to e096fe3 Compare August 28, 2026 09:53
@c-bata c-bata assigned c-bata and y0z Aug 31, 2026
@c-bata

c-bata commented Aug 31, 2026

Copy link
Copy Markdown
Member

@y0z Could you review this PR?

@c-bata c-bata left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@c-bata c-bata removed their assignment Aug 31, 2026
Comment thread optuna/trial/_frozen.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:func:optuna.trial.Trial.set_system_attr is removed in this PR.

Comment thread optuna/trial/_trial.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can this method be removed as the system_attrs property is removed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, this cannot be deleted until the system_attrs for FrozenTrial are removed. The comment isn't appropriate, so I'll delete it.

@y0z y0z left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Almost LGTM with minor comments.

@y0z y0z left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@y0z y0z removed their assignment Aug 31, 2026
@c-bata
c-bata merged commit 027f3b1 into optuna:master Aug 31, 2026
13 checks passed
@not522
not522 deleted the remove-system-attr branch September 1, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility Change that breaks compatibility.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants