potiuk commented on a change in pull request #5965: [AIRFLOW-5359] Update type 
annotations in BaseOperator
URL: https://github.com/apache/airflow/pull/5965#discussion_r319720604
 
 

 ##########
 File path: airflow/models/baseoperator.py
 ##########
 @@ -262,38 +262,38 @@ def __init__(
         self,
         task_id: str,
         owner: str = configuration.conf.get('operators', 'DEFAULT_OWNER'),
-        email: Optional[str] = None,
+        email: str = None,
         email_on_retry: bool = True,
         email_on_failure: bool = True,
         retries: int = None,
         retry_delay: timedelta = timedelta(seconds=300),
         retry_exponential_backoff: bool = False,
-        max_retry_delay: Optional[datetime] = None,
-        start_date: Optional[datetime] = None,
-        end_date: Optional[datetime] = None,
+        max_retry_delay: datetime = None,
+        start_date: datetime = None,
+        end_date: datetime = None,
         schedule_interval=None,  # not hooked as of now
         depends_on_past: bool = False,
         wait_for_downstream: bool = False,
-        dag: Optional[DAG] = None,
-        params: Optional[Dict] = None,
-        default_args: Optional[Dict] = None,
+        dag: DAG = None,
+        params: Dict = None,
+        default_args: Dict = None,
         priority_weight: int = 1,
         weight_rule: str = WeightRule.DOWNSTREAM,
         queue: str = configuration.conf.get('celery', 'default_queue'),
         pool: str = Pool.DEFAULT_POOL_NAME,
-        sla: Optional[timedelta] = None,
-        execution_timeout: Optional[timedelta] = None,
-        on_failure_callback: Optional[Callable] = None,
-        on_success_callback: Optional[Callable] = None,
-        on_retry_callback: Optional[Callable] = None,
 
 Review comment:
   Yeah. I read a bit more in detail and actually what I think now (I changed 
my mind) since there is this "trend" and possible future breaking change to 
disallow implicit Optional, maybe we should do more than that - namely we 
should convert all implicit Optionals and add '--disable-implicit-optional' 
flag to mypy and prevent anyone from ever adding implicit Optional? 

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

Reply via email to