From 000507b7b66fb9f8079c37a18eb38da9e9bf8519 Mon Sep 17 00:00:00 2001 From: pankajastro Date: Tue, 2 Dec 2025 15:12:14 +0530 Subject: [PATCH] Add targeted type: ignore for untyped decorators to fix mypy errors --- cosmos/dbt/parser/output.py | 6 +++--- cosmos/plugin/airflow2.py | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cosmos/dbt/parser/output.py b/cosmos/dbt/parser/output.py index 68ef4abf6d..cacd08bdaf 100644 --- a/cosmos/dbt/parser/output.py +++ b/cosmos/dbt/parser/output.py @@ -49,8 +49,8 @@ def parse_number_of_warnings_subprocess(result: FullOutputSubprocessResult) -> i removed_in="2.0", current_version=cosmos_version, details="Use the `cosmos.dbt.runner.parse_number_of_warnings` instead.", -) # type: ignore[misc] -def parse_number_of_warnings_dbt_runner(result: dbtRunnerResult) -> int: # type: ignore[misc] +) # type: ignore[untyped-decorator] +def parse_number_of_warnings_dbt_runner(result: dbtRunnerResult) -> int: """Parses a dbt runner result and returns the number of warnings found. This only works for dbtRunnerResult from invoking dbt build, compile, run, seed, snapshot, test, or run-operation. """ @@ -121,7 +121,7 @@ def clean_line(line: str) -> str: removed_in="2.0", current_version=cosmos_version, details="Use the `cosmos.dbt.runner.extract_message_by_status` instead.", -) # type: ignore[misc] +) # type: ignore[untyped-decorator] def extract_dbt_runner_issues( result: dbtRunnerResult, status_levels: list[str] = ["warn"] ) -> Tuple[List[str], List[str]]: # type: ignore[misc] diff --git a/cosmos/plugin/airflow2.py b/cosmos/plugin/airflow2.py index 2e04794533..332095c860 100644 --- a/cosmos/plugin/airflow2.py +++ b/cosmos/plugin/airflow2.py @@ -133,15 +133,15 @@ def create_blueprint( # Make sure the static folder is not overwritten, as we want to use it. return super().create_blueprint(appbuilder, endpoint=endpoint, static_folder=self.static_folder) # type: ignore[no-any-return] - @expose("/dbt_docs") # type: ignore[misc] - @has_access(MENU_ACCESS_PERMISSIONS) # type: ignore[misc] + @expose("/dbt_docs") # type: ignore[untyped-decorator] + @has_access(MENU_ACCESS_PERMISSIONS) # type: ignore[untyped-decorator] def dbt_docs(self) -> str: if dbt_docs_dir is None: return self.render_template("dbt_docs_not_set_up.html") # type: ignore[no-any-return,no-untyped-call] return self.render_template("dbt_docs.html") # type: ignore[no-any-return,no-untyped-call] - @expose("/dbt_docs_index.html") # type: ignore[misc] - @has_access(MENU_ACCESS_PERMISSIONS) # type: ignore[misc] + @expose("/dbt_docs_index.html") # type: ignore[untyped-decorator] + @has_access(MENU_ACCESS_PERMISSIONS) # type: ignore[untyped-decorator] def dbt_docs_index(self) -> Tuple[str, int, Dict[str, Any]]: if dbt_docs_dir is None: abort(404) @@ -153,8 +153,8 @@ def dbt_docs_index(self) -> Tuple[str, int, Dict[str, Any]]: html = html.replace("", f"{IFRAME_SCRIPT}") return html, 200, {"Content-Security-Policy": "frame-ancestors 'self'"} - @expose("/catalog.json") # type: ignore[misc] - @has_access(MENU_ACCESS_PERMISSIONS) # type: ignore[misc] + @expose("/catalog.json") # type: ignore[untyped-decorator] + @has_access(MENU_ACCESS_PERMISSIONS) # type: ignore[untyped-decorator] def catalog(self) -> Tuple[str, int, Dict[str, Any]]: if dbt_docs_dir is None: abort(404) @@ -165,8 +165,8 @@ def catalog(self) -> Tuple[str, int, Dict[str, Any]]: else: return data, 200, {"Content-Type": "application/json"} - @expose("/manifest.json") # type: ignore[misc] - @has_access(MENU_ACCESS_PERMISSIONS) # type: ignore[misc] + @expose("/manifest.json") # type: ignore[untyped-decorator] + @has_access(MENU_ACCESS_PERMISSIONS) # type: ignore[untyped-decorator] def manifest(self) -> Tuple[str, int, Dict[str, Any]]: if dbt_docs_dir is None: abort(404)