Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add TaskOnKart dump type #368

Merged
merged 1 commit into from
Sep 4, 2024
Merged

add TaskOnKart dump type #368

merged 1 commit into from
Sep 4, 2024

Conversation

kitagry
Copy link
Member

@kitagry kitagry commented Apr 15, 2024

Add type to TaskOnKart. we can set type.

class MyTask(gokart.TaskOnKart[str]):
    def run(self):
        self.dump(1)  # mypy error: expected str but got int
        self.dump('1')  # mypy ok

Copy link
Collaborator

@hirosassa hirosassa left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -79,6 +86,7 @@ def test_read_config(self):
config_file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config', 'test_config.ini')
gokart.utils.add_config(config_file_path)
output = gokart.build(_DummyTask(), reset_register=False)
assert_type(output, str)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 👍 👍 👍

Copy link
Contributor

@hiro-o918 hiro-o918 left a comment

Choose a reason for hiding this comment

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

LGTM

@kitagry kitagry merged commit 85f3ebc into master Sep 4, 2024
5 checks passed
@kitagry kitagry deleted the add-build-type branch September 4, 2024 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants