Skip to content

Commit

Permalink
Add stub implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed Nov 22, 2023
1 parent 05bd0ad commit 6e606ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/brad/connection/pyathena_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pyathena
import pyathena.connection
import pyathena.cursor
from typing import Optional, List
from typing import Any, Iterable, Optional, List

from .cursor import Cursor, Row

Expand Down Expand Up @@ -33,6 +33,9 @@ async def rollback(self) -> None:
def execute_sync(self, query: str) -> None:
self._impl.execute(query)

def executemany_sync(self, query: str, batch: Iterable[Any]) -> None:
raise RuntimeError("Not supported on Athena.")

def fetchone_sync(self) -> Optional[Row]:
return self._impl.fetchone() # type: ignore

Expand Down
5 changes: 4 additions & 1 deletion src/brad/connection/redshift_cursor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio
import redshift_connector
from typing import Optional, List
from typing import Any, Iterable, Optional, List

from .cursor import Cursor, Row

Expand Down Expand Up @@ -36,6 +36,9 @@ async def rollback(self) -> None:
def execute_sync(self, query: str) -> None:
self._impl.execute(query)

def executemany_sync(self, query: str, batch: Iterable[Any]) -> None:
raise RuntimeError("Not supported on Redshift.")

def fetchone_sync(self) -> Optional[Row]:
return self._impl.fetchone()

Expand Down

0 comments on commit 6e606ea

Please sign in to comment.