Skip to content

Fix mypy error about Chainer#4410

Merged
toshihikoyanase merged 2 commits intooptuna:masterfrom
Alnusjaponica:fix-checks-integration-chainer
Feb 10, 2023
Merged

Fix mypy error about Chainer#4410
toshihikoyanase merged 2 commits intooptuna:masterfrom
Alnusjaponica:fix-checks-integration-chainer

Conversation

@Alnusjaponica
Copy link
Copy Markdown
Contributor

Motivation

Resolve #4116

Description of the changes

Ignore mypy error which occurs at the 23rd line of tests/integration_tests/test_chainer.py.
Note that mypy error of the line was used to be ignored before PR #4276 but I removed type: ignore to reduce unused warnings. Mypy recognize this as error again from 1.0.0.

@Alnusjaponica Alnusjaponica changed the title Fix mypy error Fix mypy error about Chainer Feb 9, 2023
@Alnusjaponica
Copy link
Copy Markdown
Contributor Author

I confirmed that this PR fixes mypy error in Checks (integration) together with #4413.
See here to confirm.

Copy link
Copy Markdown
Member

@toshihikoyanase toshihikoyanase left a comment

Choose a reason for hiding this comment

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

Thank you for your PR. LGTM.
Let me merge this PR since it only updates the code comments for mypy in the test file.


if not _imports.is_successful():
DatasetMixin = object # NOQA
DatasetMixin = object # type: ignore[assignment, misc] # NOQA
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.

[Note] This fix corresponds to the following errors in https://github.com/optuna/optuna/actions/runs/4139175958/jobs/7156458918:

tests/integration_tests/test_chainer.py:23: error: Cannot assign to a type  [misc]
tests/integration_tests/test_chainer.py:23: error: Incompatible types in assignment (expression has type "Type[object]", variable has type "Type[DatasetMixin]")  [assignment]

@toshihikoyanase toshihikoyanase added the test Unit test. label Feb 10, 2023
@toshihikoyanase toshihikoyanase added this to the v3.2.0 milestone Feb 10, 2023
@toshihikoyanase toshihikoyanase merged commit 7b3824a into optuna:master Feb 10, 2023
@Alnusjaponica Alnusjaponica deleted the fix-checks-integration-chainer branch February 16, 2023 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Unit test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolve mypy error on master branch

2 participants