Joffreybvn commented on code in PR #36205:
URL: https://github.com/apache/airflow/pull/36205#discussion_r1434484284


##########
airflow/providers/databricks/hooks/databricks_sql.py:
##########
@@ -167,7 +195,7 @@ def run(
         handler: Callable[[Any], T] = ...,
         split_statements: bool = ...,
         return_last: bool = ...,
-    ) -> T | list[T]:
+    ) -> tuple | list[tuple] | list[list[tuple] | tuple] | None:

Review Comment:
   Mypy was not happy with `-> tuple | list[tuple] | list[list[tuple] | tuple]` 
as output - which is correct. I got error: "*Overloaded function signatures 1 
and 2 overlap with incompatible return types*".
   
   [Following mypy 
docs](https://mypy.readthedocs.io/en/stable/more_types.html#type-checking-the-variants),
 I added a `None` for it to be stop complaining. But that's not correct, this 
method cannot return None when a handler is provided...
   
   Implementing definitive typing is out of the scope of this PR, and I admit 
mypy beat me on that case. Thus I let that for #36224 - but I'm whiling to help 
on that issue too of course.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to