potiuk commented on code in PR #29080:
URL: https://github.com/apache/airflow/pull/29080#discussion_r1083266233


##########
scripts/ci/pre_commit/pre_commit_update_common_sql_api_stubs.py:
##########
@@ -130,35 +148,39 @@ def 
post_process_historically_publicised_methods(stub_file_path: Path, line: str
             # provider to 2.*, the old providers (mainly google providers) 
might still use them.
             new_lines.append("def _parse_boolean(val: str) -> str | bool: ...")
             new_lines.append("def parse_boolean(val: str) -> str | bool: ...")
-        elif line.strip() == "class SQLExecuteQueryOperator(BaseSQLOperator):":
+        elif stripped_line == "class 
SQLExecuteQueryOperator(BaseSQLOperator):":
             # The "_raise_exception" method is really part of the public API 
and should not be removed
             new_lines.append(line)
             new_lines.append("    def _raise_exception(self, exception_string: 
str) -> Incomplete: ...")
+        elif stripped_line.startswith("from _typeshed import Incomplete"):
+            new_lines.append(line + "  # noqa: F401")
+        elif stripped_line.startswith("from typing import") and "Union" not in 
line:
+            new_lines.append(line + ", Union")

Review Comment:
   Hack. But works (until we have single-line import here 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