-
Notifications
You must be signed in to change notification settings - Fork 60
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
chore: add tests for gokart parameters #389
Conversation
c225dd9
to
534035d
Compare
f5b2df0
to
c08ba6d
Compare
@@ -404,9 +406,13 @@ def is_parameter_call(expr: Expression) -> bool: | |||
type_info = callee.node | |||
if type_info is None and isinstance(callee.expr, NameExpr): | |||
return PARAMETER_FULLNAME_MATCHER.match(f'{callee.expr.name}.{callee.name}') is not None | |||
if isinstance(type_info, TypeInfo) and PARAMETER_FULLNAME_MATCHER.match(type_info.fullname): | |||
return True | |||
elif isinstance(callee, NameExpr): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These conditions are very complicated to review, because these lines are determined by print debugging by tests.
So please check the test cases for this update
|
||
# TaskOnKart parameters: | ||
# - `complete_check_at_run` | ||
MyTask(foo=1, bar='bar', baz=False, complete_check_at_run=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add complete_check_at_run
parameter to check #388 is resolved
MyTask(foo='1') | ||
# TaskOnKart parameters: | ||
# - `complete_check_at_run` | ||
MyTask(foo='1', baz='not bool', complete_check_at_run='not bool') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also check invalid type for the attributes of gokart.TaskOnKart
gokart/mypy.py
Outdated
# the transformation does not affect because the class has `__init__` method of `gokart.TaskOnKart`. | ||
# | ||
# NOTE: `gokart.task.luigi.Task` condition is required for the release of luigi versions without py.typed | ||
if fullname == 'gokart.task.luigi.Task' or fullname == 'luigi.task.Task': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if fullname == 'gokart.task.luigi.Task' or fullname == 'luigi.task.Task': | |
if fullname in ['gokart.task.luigi.Task', 'luigi.task.Task']: |
c08ba6d
to
fcb8be8
Compare
closes: #388