Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ tenacity = "^8.2.3"
pyarrow = "^15.0.2"
cbor2 = "^5.6.3"
pandas = "^2.2.2"
StrEnum = "^0.4.15"

[tool.poetry.group.dev.dependencies]
mypy = "^1.8.0"
Expand Down
3 changes: 2 additions & 1 deletion wherobots/db/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from enum import StrEnum, auto
from enum import auto
from strenum import StrEnum

from .region import Region
from .runtime import Runtime
Expand Down
12 changes: 6 additions & 6 deletions wherobots/db/cursor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import queue
from typing import Any
from typing import Any, Optional

from .errors import ProgrammingError, DatabaseError

Expand All @@ -11,20 +11,20 @@ def __init__(self, exec_fn, cancel_fn):
self.__cancel_fn = cancel_fn

self.__queue: queue.Queue = queue.Queue()
self.__results: list[Any] | None = None
self.__current_execution_id: str | None = None
self.__results: Optional[list[Any]] = None
self.__current_execution_id: Optional[str] = None
self.__current_row: int = 0

# Description and row count are set by the last executed operation.
# Their default values are defined by PEP-0249.
self.__description: str | None = None
self.__description: Optional[str] = None
self.__rowcount: int = -1

# Array-size is also defined by PEP-0249 and is expected to be read/writable.
self.arraysize: int = 1

@property
def description(self) -> str | None:
def description(self) -> Optional[str]:
return self.__description

@property
Expand All @@ -34,7 +34,7 @@ def rowcount(self) -> int:
def __on_execution_result(self, result) -> None:
self.__queue.put(result)

def __get_results(self) -> list[Any] | None:
def __get_results(self) -> Optional[list[Any]]:
if not self.__current_execution_id:
raise ProgrammingError("No query has been executed yet")
if self.__results is not None:
Expand Down