Skip to content

Commit 3992962

Browse files
committed
Added mypy ignore hints for computed Pydantic fields.
Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com>
1 parent f6e9cf9 commit 3992962

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

sqlmesh/core/config/connection.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ class ConnectionConfig(abc.ABC, BaseConfig):
110110
catalog_type_overrides: t.Optional[t.Dict[str, str]] = None
111111

112112
# Whether to share a single connection across threads or create a new connection per thread.
113-
@computed_field
113+
#
114+
# MyPy throws a "Decorators on top of @property are not supported" error despite this being a
115+
# valid decoration, and Pydantic recommend disabling the MyPy hint for this reason - see:
116+
# https://pydantic.dev/docs/validation/2.0/usage/computed_fields/
117+
@computed_field # type: ignore[prop-decorator]
114118
@property
115119
def shared_connection(self) -> bool:
116120
return False
@@ -314,7 +318,7 @@ class BaseDuckDBConnectionConfig(ConnectionConfig):
314318

315319
token: t.Optional[str] = None
316320

317-
@computed_field
321+
@computed_field # type: ignore[prop-decorator]
318322
@property
319323
def shared_connection(self) -> bool:
320324
return True
@@ -829,7 +833,7 @@ class DatabricksConnectionConfig(ConnectionConfig):
829833
_concurrent_tasks_validator = concurrent_tasks_validator
830834
_http_headers_validator = http_headers_validator
831835

832-
@computed_field
836+
@computed_field # type: ignore[prop-decorator]
833837
@property
834838
def shared_connection(self) -> bool:
835839
"""The connection should only be shared if U2M OAuth is being used"""

0 commit comments

Comments
 (0)