from typing import ContextManager, Protocol, Any, runtime_checkable from snowflake.connector.cursor import SnowflakeCursor @runtime_checkable class PEP249Cursor(Protocol): """PEP 249 Cursor Object Protocol.""" @property def description(self) -> Any: ... @property def rowcount(self) -> int | None: ... def execute(self, sql: str, params: Any = (), /) -> Any: ... def fetchall(self) -> list[Any] | tuple[tuple[Any, ...], ...]: ... def fetchmany(self, size: int) -> list[Any] | tuple[tuple[Any, ...], ...]: ... def fetchone(self) -> tuple[Any, ...] | None: ... def close(self) -> None: ... def get_cursor() -> PEP249Cursor: c: SnowflakeCursor = SnowflakeCursor(None) # Mocking constructor return c