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 2019/05/25 18:06:51 UTC

[GitHub] [airflow] pgagnon commented on a change in pull request #5327: [AIRFLOW-4205] Replace type comments by native Python typing

pgagnon 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_r287570867
 
 

 ##########
 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:
   My 2c, I am personally a big fan of `--no-implicit-optional` in mypy checks. I find that it forces contributors to reason explicitly about null safety, and is much clearer for readers.

----------------------------------------------------------------
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