Skip to content

Commit

Permalink
Somy pyright fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dfalbel committed Apr 1, 2024
1 parent a8f816f commit 0aa8d13
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ def _wrap_connection(self, obj: Any) -> Connection:
return SQLite3Connection(obj)
elif safe_isinstance(obj, "sqlalchemy", "Engine"):
return SQLAlchemyConnection(obj)
else:
type_name = type(obj).__name__
raise UnsupportedConnectionError(f"Unsupported connection type {type(obj)}")

def object_is_supported(self, obj: Any) -> bool:
"""
Expand All @@ -227,11 +230,11 @@ def object_is_supported(self, obj: Any) -> bool:
obj, "sqlalchemy", "Engine"
)

def variable_has_active_connection(self, variable_path: List[str]) -> bool:
def variable_has_active_connection(self, variable_name: str) -> bool:
"""
Checks if the given variable path has an active connection.
"""
return tuple(variable_path) in self.path_to_comm_ids
return ([variable_name]) in self.path_to_comm_ids

def handle_variable_updated(self, variable_name, value) -> None:
"""
Expand Down

0 comments on commit 0aa8d13

Please sign in to comment.