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

feat: update plugin overcomes conflicting parameter types #386

Merged
merged 4 commits into from
Jul 23, 2024

Conversation

hiro-o918
Copy link
Contributor

@hiro-o918 hiro-o918 commented Jul 20, 2024

What

update plugin overcomes conflicting parameter types

foo: str = luigi.Parameter() # right side handled as unannotated

Future Work

#387

@hiro-o918 hiro-o918 force-pushed the feature/precise-type-annotation branch 2 times, most recently from e94c7b3 to b8df029 Compare July 20, 2024 06:30
@hiro-o918 hiro-o918 changed the title chore: set precise type annotations by updatint pyproject.toml chore: set precise type annotations by updating pyproject.toml Jul 20, 2024
@hiro-o918 hiro-o918 force-pushed the feature/precise-type-annotation branch from 2da0e1c to e39344f Compare July 20, 2024 06:39
@hiro-o918 hiro-o918 changed the base branch from master to feature/mypy-plugin July 20, 2024 06:40
@hiro-o918 hiro-o918 force-pushed the feature/precise-type-annotation branch 13 times, most recently from 75893d5 to 18cefdf Compare July 20, 2024 08:05
@hiro-o918 hiro-o918 changed the title chore: set precise type annotations by updating pyproject.toml feat: update plugin overcomes conflicting parameter types Jul 20, 2024
# As the following code snippet, the type of `foo` is `int` but the assigned value is `luigi.IntParameter()`.
# foo: int = luigi.IntParameter()
# TODO: infer mypy type from the parameter type.
return AnyType(TypeOfAny.unannotated)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If no default value, a parameter handled as AnyType(TypeOfAny.unannotated)
Due to this, type annotation for the TaskOnKart takes precedence.

@hiro-o918 hiro-o918 force-pushed the feature/precise-type-annotation branch from 18cefdf to cfbbcaa Compare July 20, 2024 08:12
@hiro-o918 hiro-o918 force-pushed the feature/mypy-plugin branch 4 times, most recently from ec0013c to 08e2b74 Compare July 21, 2024 07:33
Base automatically changed from feature/mypy-plugin to master July 21, 2024 09:39
@hiro-o918 hiro-o918 force-pushed the feature/precise-type-annotation branch from cfbbcaa to 448b4ae Compare July 21, 2024 12:40
@hiro-o918 hiro-o918 force-pushed the feature/precise-type-annotation branch from a0768e9 to 51cd342 Compare July 22, 2024 01:24
@hiro-o918 hiro-o918 force-pushed the feature/precise-type-annotation branch from 51cd342 to a31a847 Compare July 22, 2024 01:28
@@ -59,7 +59,7 @@ def set_task_lock(task_lock_params: TaskLockParams) -> redis.lock.Lock:

def set_lock_scheduler(task_lock: redis.lock.Lock, task_lock_params: TaskLockParams) -> BackgroundScheduler:
scheduler = BackgroundScheduler()
extend_lock = functools.partial(_extend_lock, task_lock=task_lock, redis_timeout=task_lock_params.redis_timeout)
extend_lock = functools.partial(_extend_lock, task_lock=task_lock, redis_timeout=task_lock_params.redis_timeout or 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

_extend_lock does not accept optional value

Copy link
Member

@kitagry kitagry left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Looks good!

@kitagry kitagry merged commit 222c40a into master Jul 23, 2024
5 checks passed
@kitagry kitagry deleted the feature/precise-type-annotation branch July 23, 2024 23:42
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