mlgruby commented on a change in pull request #11170:
URL: https://github.com/apache/airflow/pull/11170#discussion_r495595647
##########
File path: airflow/providers/databricks/hooks/databricks.py
##########
@@ -325,9 +331,9 @@ class _TokenAuth(AuthBase):
magic function.
"""
- def __init__(self, token):
+ def __init__(self, token: str) -> None:
self.token = token
- def __call__(self, r):
+ def __call__(self, r: PreparedRequest) -> PreparedRequest:
Review comment:
you can find more info here:
https://requests.readthedocs.io/en/master/api/#requests.PreparedRequest
If I am not wrong your request here it to provide a link in the comment
(here) but not in the code!
##########
File path: airflow/providers/databricks/operators/databricks.py
##########
@@ -250,23 +251,23 @@ class DatabricksSubmitRunOperator(BaseOperator):
def __init__(
self,
*,
- json=None,
- spark_jar_task=None,
- notebook_task=None,
- spark_python_task=None,
- spark_submit_task=None,
- new_cluster=None,
- existing_cluster_id=None,
- libraries=None,
- run_name=None,
- timeout_seconds=None,
- databricks_conn_id='databricks_default',
- polling_period_seconds=30,
- databricks_retry_limit=3,
- databricks_retry_delay=1,
- do_xcom_push=False,
+ json: Optional[Any] = None,
Review comment:
tried that but below assignment is making mypy check a fail.
```python
self.json = _deep_string_coerce(self.json) #line 301
```
`_deep_string_coerce` return type is `Union[str, list, dict]` is not
matching with the only 'dict' of JSON
----------------------------------------------------------------
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]