potiuk commented on a change in pull request #5327: [AIRFLOW-4205] Replace type
comments by native Python typing
URL: https://github.com/apache/airflow/pull/5327#discussion_r287570612
##########
File path: airflow/models/baseoperator.py
##########
@@ -238,40 +238,40 @@ class derived from this one results in the creation of a
task object,
@apply_defaults
def __init__(
self,
- task_id, # type: str
- owner=configuration.conf.get('operators', 'DEFAULT_OWNER'), # type:
str
- email=None, # type: Optional[str]
- email_on_retry=True, # type: bool
- email_on_failure=True, # type: bool
- retries=0, # type: int
- retry_delay=timedelta(seconds=300), # type: timedelta
- retry_exponential_backoff=False, # type: bool
- max_retry_delay=None, # type: Optional[datetime]
- start_date=None, # type: Optional[datetime]
- end_date=None, # type: Optional[datetime]
+ task_id: str,
+ owner: str = configuration.conf.get('operators', 'DEFAULT_OWNER'),
+ email: Optional[str] = None,
Review comment:
No need for Optional here - it will be inferred automatically via = None.
(though maybe you want to leave it for clarity).
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services