From 19e661fd481bb18883284b6d4ff2491e59055e9e Mon Sep 17 00:00:00 2001 From: Quigley Malcolm Date: Tue, 27 Aug 2024 10:48:05 -0500 Subject: [PATCH 1/2] Fix type hinting in `core/dbt/version.py` * Added type hints to `_get_core_msg_lines` parameters * Removed unused `# type: ignore` comment --- core/dbt/version.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/dbt/version.py b/core/dbt/version.py index a4a219e9529..475e98e9d56 100644 --- a/core/dbt/version.py +++ b/core/dbt/version.py @@ -49,7 +49,10 @@ def get_latest_version( return semver.VersionSpecifier.from_version_string(version_string) -def _get_core_msg_lines(installed, latest) -> Tuple[List[List[str]], str]: +def _get_core_msg_lines( + installed: semver.VersionSpecifier, + latest: Optional[semver.VersionSpecifier], +) -> Tuple[List[List[str]], str]: installed_s = installed.to_version_string(skip_matcher=True) installed_line = ["installed", installed_s, ""] update_info = "" @@ -208,7 +211,7 @@ def _get_dbt_plugins_info() -> Iterator[Tuple[str, str]]: except ImportError: # not an adapter continue - yield plugin_name, mod.version # type: ignore + yield plugin_name, mod.version def _get_adapter_plugin_names() -> Iterator[str]: From 552c7c93d367162502d0533684f9751f2b82c535 Mon Sep 17 00:00:00 2001 From: Quigley Malcolm Date: Tue, 27 Aug 2024 10:50:36 -0500 Subject: [PATCH 2/2] Changie doc for version.py typing improvements --- .changes/unreleased/Under the Hood-20240827-105014.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Under the Hood-20240827-105014.yaml diff --git a/.changes/unreleased/Under the Hood-20240827-105014.yaml b/.changes/unreleased/Under the Hood-20240827-105014.yaml new file mode 100644 index 00000000000..318f9ccb1b0 --- /dev/null +++ b/.changes/unreleased/Under the Hood-20240827-105014.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: Additional type hints for `core/dbt/version.py` +time: 2024-08-27T10:50:14.047859-05:00 +custom: + Author: QMalcolm + Issue: "10612"