You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/01/04 22:33:23 UTC
[GitHub] [airflow] mustafagok opened a new pull request #7050:
[AIRFLOW-XXXX] Update types in docstrings
mustafagok opened a new pull request #7050: [AIRFLOW-XXXX] Update types in docstrings
URL: https://github.com/apache/airflow/pull/7050
All changes except test_external_task_sensor.py are docstring changes. The types in docstrings were updated to fix warnings like: "Expected type 'x', got 'y' instead".
In test_templated_sensor (test_external_task_sensor.py) unit test method, self.dag was used instead of creating a local variable named "dag".
---
Link to JIRA issue: https://issues.apache.org/jira/browse/AIRFLOW-XXXX
- [x] Description above provides context of the change
- [x] Commit message starts with `[AIRFLOW-NNNN]`, where AIRFLOW-NNNN = JIRA ID*
- [ ] Unit tests coverage for changes (not needed for documentation changes)
- [x] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
- [x] Relevant documentation is updated including usage instructions.
- [x] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
(*) For document-only changes, no JIRA issue is needed. Commit message starts `[AIRFLOW-XXXX]`.
---
In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] mik-laj merged pull request #7050: [AIRFLOW-XXXX] Update
types in docstrings
Posted by GitBox <gi...@apache.org>.
mik-laj merged pull request #7050: [AIRFLOW-XXXX] Update types in docstrings
URL: https://github.com/apache/airflow/pull/7050
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] mik-laj commented on a change in pull request #7050:
[AIRFLOW-XXXX] Update types in docstrings
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #7050: [AIRFLOW-XXXX] Update types in docstrings
URL: https://github.com/apache/airflow/pull/7050#discussion_r363059894
##########
File path: airflow/sensors/external_task_sensor.py
##########
@@ -47,11 +47,11 @@ class ExternalTaskSensor(BaseSensorOperator):
For yesterday, use [positive!] datetime.timedelta(days=1). Either
execution_delta or execution_date_fn can be passed to
ExternalTaskSensor, but not both.
- :type execution_delta: datetime.timedelta
+ :type execution_delta: datetime.timedelta or None
Review comment:
```suggestion
:type execution_delta: Optional[datetime.timedelta]
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] mik-laj commented on a change in pull request #7050:
[AIRFLOW-XXXX] Update types in docstrings
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #7050: [AIRFLOW-XXXX] Update types in docstrings
URL: https://github.com/apache/airflow/pull/7050#discussion_r363059888
##########
File path: airflow/sensors/external_task_sensor.py
##########
@@ -47,11 +47,11 @@ class ExternalTaskSensor(BaseSensorOperator):
For yesterday, use [positive!] datetime.timedelta(days=1). Either
execution_delta or execution_date_fn can be passed to
ExternalTaskSensor, but not both.
- :type execution_delta: datetime.timedelta
+ :type execution_delta: datetime.timedelta or None
:param execution_date_fn: function that receives the current execution date
and returns the desired execution dates to query. Either execution_delta
or execution_date_fn can be passed to ExternalTaskSensor, but not both.
- :type execution_date_fn: callable
+ :type execution_date_fn: function or None
Review comment:
```suggestion
:type execution_date_fn: OptionalCallable]
```
We prefer PEP syntax. It is also correct and more standardized.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] mik-laj commented on a change in pull request #7050:
[AIRFLOW-XXXX] Update types in docstrings
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #7050: [AIRFLOW-XXXX] Update types in docstrings
URL: https://github.com/apache/airflow/pull/7050#discussion_r363061034
##########
File path: tests/sensors/test_external_task_sensor.py
##########
@@ -95,9 +95,7 @@ def test_external_dag_sensor(self):
)
def test_templated_sensor(self):
- dag = DAG(TEST_DAG_ID, self.args)
-
- with dag:
+ with self.dag:
Review comment:
Can you do it in separate PR with JIRA ticket?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] mik-laj commented on a change in pull request #7050:
[AIRFLOW-XXXX] Update types in docstrings
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #7050: [AIRFLOW-XXXX] Update types in docstrings
URL: https://github.com/apache/airflow/pull/7050#discussion_r363099793
##########
File path: airflow/sensors/base_sensor_operator.py
##########
@@ -42,9 +42,9 @@ class BaseSensorOperator(BaseOperator, SkipMixin):
:type soft_fail: bool
:param poke_interval: Time in seconds that the job should wait in
between each tries
- :type poke_interval: int
+ :type poke_interval: float
Review comment:
For me it should be a float here. We use it in two places. In timedelta (seconds) and in sleep. The second case is obvious, but the second is not, so I looked at code.
![Screenshot 2020-01-05 at 16 22 58](https://user-images.githubusercontent.com/12058428/71782186-ac18c500-2fd7-11ea-9b8a-932ceb8f5b39.png)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] codecov-io edited a comment on issue #7050:
[AIRFLOW-XXXX] Update types in docstrings
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #7050: [AIRFLOW-XXXX] Update types in docstrings
URL: https://github.com/apache/airflow/pull/7050#issuecomment-570938950
# [Codecov](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=h1) Report
> Merging [#7050](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/382dd7c3c2667a740ba3cea4df09bb27590d1372?src=pr&el=desc) will **decrease** coverage by `0.08%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/7050/graphs/tree.svg?width=650&token=WdLKlKHOAU&height=150&src=pr)](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #7050 +/- ##
==========================================
- Coverage 84.91% 84.82% -0.09%
==========================================
Files 679 679
Lines 38647 39063 +416
==========================================
+ Hits 32817 33137 +320
- Misses 5830 5926 +96
```
| [Impacted Files](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [airflow/sensors/base\_sensor\_operator.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9zZW5zb3JzL2Jhc2Vfc2Vuc29yX29wZXJhdG9yLnB5) | `98.61% <ø> (ø)` | :arrow_up: |
| [...irflow/contrib/operators/emr\_add\_steps\_operator.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9jb250cmliL29wZXJhdG9ycy9lbXJfYWRkX3N0ZXBzX29wZXJhdG9yLnB5) | `91.42% <ø> (ø)` | :arrow_up: |
| [...ib/operators/azure\_container\_instances\_operator.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9jb250cmliL29wZXJhdG9ycy9henVyZV9jb250YWluZXJfaW5zdGFuY2VzX29wZXJhdG9yLnB5) | `78.14% <ø> (ø)` | :arrow_up: |
| [airflow/sensors/external\_task\_sensor.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9zZW5zb3JzL2V4dGVybmFsX3Rhc2tfc2Vuc29yLnB5) | `85.96% <ø> (ø)` | :arrow_up: |
| [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0%> (-55.56%)` | :arrow_down: |
| [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0%> (-47.06%)` | :arrow_down: |
| [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `45.25% <0%> (-46.72%)` | :arrow_down: |
| [airflow/kubernetes/refresh\_config.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3JlZnJlc2hfY29uZmlnLnB5) | `50.98% <0%> (-23.53%)` | :arrow_down: |
| [...rflow/contrib/operators/kubernetes\_pod\_operator.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9jb250cmliL29wZXJhdG9ycy9rdWJlcm5ldGVzX3BvZF9vcGVyYXRvci5weQ==) | `78.75% <0%> (-20%)` | :arrow_down: |
| [airflow/models/dagrun.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9tb2RlbHMvZGFncnVuLnB5) | `97.03% <0%> (+0.45%)` | :arrow_up: |
| ... and [7 more](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=footer). Last update [382dd7c...e1a1364](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] kaxil commented on a change in pull request #7050:
[AIRFLOW-XXXX] Update types in docstrings
Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #7050: [AIRFLOW-XXXX] Update types in docstrings
URL: https://github.com/apache/airflow/pull/7050#discussion_r363099067
##########
File path: airflow/sensors/base_sensor_operator.py
##########
@@ -42,9 +42,9 @@ class BaseSensorOperator(BaseOperator, SkipMixin):
:type soft_fail: bool
:param poke_interval: Time in seconds that the job should wait in
between each tries
- :type poke_interval: int
+ :type poke_interval: float
Review comment:
I think int is the correct type, isn't it @mik-laj ?
We should probably update https://github.com/apache/airflow/pull/7050/files#diff-81901d44cd480538f1f35b641b9ede0cR70
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] mik-laj commented on a change in pull request #7050:
[AIRFLOW-XXXX] Update types in docstrings
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #7050: [AIRFLOW-XXXX] Update types in docstrings
URL: https://github.com/apache/airflow/pull/7050#discussion_r363059882
##########
File path: airflow/contrib/operators/azure_container_instances_operator.py
##########
@@ -56,7 +56,7 @@ class AzureContainerInstancesOperator(BaseOperator):
:type ci_conn_id: str
:param registry_conn_id: connection id of a user which can login to a
private docker registry. If None, we assume a public registry
- :type registry_conn_id: str
+ :type registry_conn_id: str or None
Review comment:
```suggestion
:type registry_conn_id: Optiona[str]
```
It is also correct and more standardized.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] codecov-io commented on issue #7050: [AIRFLOW-XXXX]
Update types in docstrings
Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #7050: [AIRFLOW-XXXX] Update types in docstrings
URL: https://github.com/apache/airflow/pull/7050#issuecomment-570938950
# [Codecov](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=h1) Report
> Merging [#7050](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/382dd7c3c2667a740ba3cea4df09bb27590d1372?src=pr&el=desc) will **decrease** coverage by `0.42%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/7050/graphs/tree.svg?width=650&token=WdLKlKHOAU&height=150&src=pr)](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #7050 +/- ##
==========================================
- Coverage 84.91% 84.48% -0.43%
==========================================
Files 679 679
Lines 38647 38647
==========================================
- Hits 32817 32651 -166
- Misses 5830 5996 +166
```
| [Impacted Files](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [airflow/sensors/base\_sensor\_operator.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9zZW5zb3JzL2Jhc2Vfc2Vuc29yX29wZXJhdG9yLnB5) | `98.61% <ø> (ø)` | :arrow_up: |
| [...irflow/contrib/operators/emr\_add\_steps\_operator.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9jb250cmliL29wZXJhdG9ycy9lbXJfYWRkX3N0ZXBzX29wZXJhdG9yLnB5) | `91.42% <ø> (ø)` | :arrow_up: |
| [...ib/operators/azure\_container\_instances\_operator.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9jb250cmliL29wZXJhdG9ycy9henVyZV9jb250YWluZXJfaW5zdGFuY2VzX29wZXJhdG9yLnB5) | `78.14% <ø> (ø)` | :arrow_up: |
| [airflow/sensors/external\_task\_sensor.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9zZW5zb3JzL2V4dGVybmFsX3Rhc2tfc2Vuc29yLnB5) | `85.96% <ø> (ø)` | :arrow_up: |
| [airflow/operators/mysql\_operator.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9vcGVyYXRvcnMvbXlzcWxfb3BlcmF0b3IucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [airflow/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9vcGVyYXRvcnMvbXlzcWxfdG9faGl2ZS5weQ==) | `0% <0%> (-100%)` | :arrow_down: |
| [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0%> (-55.56%)` | :arrow_down: |
| [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0%> (-47.06%)` | :arrow_down: |
| [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `45.25% <0%> (-46.72%)` | :arrow_down: |
| [airflow/kubernetes/refresh\_config.py](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3JlZnJlc2hfY29uZmlnLnB5) | `50.98% <0%> (-23.53%)` | :arrow_down: |
| ... and [8 more](https://codecov.io/gh/apache/airflow/pull/7050/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=footer). Last update [382dd7c...e1a1364](https://codecov.io/gh/apache/airflow/pull/7050?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services