-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Add typing for jira provider #10005
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 typing for jira provider #10005
Conversation
|
|
||
| super().__init__(jira_conn_id=jira_conn_id, | ||
| result_processor=field_checker_func, | ||
| *args, |
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.
Remove *args to avoid mypy issue:
python/mypy#6799
#9784
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 should remove args in more operators:
#9942
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.
Can you help me with that too in a saperate PR? That way, other people won't face the problem you had.
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.
Sure will look into soon.
| result_processor=None, | ||
| get_jira_resource_method=None, | ||
| jira_conn_id: str = 'jira_default', | ||
| jira_method: Any = None, |
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.
| jira_method: Any = None, | |
| jira_method: Optional[str] = None, |
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.
Made this change but requires type hint on line 83 because getattr doesn't like getting a None passed as argument
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.
This parameter seems to be required. If the user does not pass this argument, they will always have an error.
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.
Thanks...changed parameter to required
…ype ignore hit to line 83
| jira_conn_id: str = 'jira_default', | ||
| jira_method: Optional[str] = None, |
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.
| jira_conn_id: str = 'jira_default', | |
| jira_method: Optional[str] = None, | |
| jira_method str, | |
| jira_conn_id: str = 'jira_default', |
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.
Thanks made this change
|
hi @mik-laj, should i update the sensor tests to pass method name parameter so your changes to the sensor will pass the tests? |
|
Yes. Please do it. :-D |
Add typing for jira provider
issue #9708
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.