Skip to content
Merged
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
12 changes: 6 additions & 6 deletions icij-worker/icij_worker/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
from functools import lru_cache
from typing import Callable, ClassVar, Sequence, Union, cast

from psycopg.cursor import BaseCursor
from psycopg.rows import RowMaker
from pydantic import Field, root_validator, validator
from pydantic.utils import ROOT_KEY
from typing_extensions import Any, Dict, List, Optional, final
Expand Down Expand Up @@ -319,7 +317,7 @@ def from_neo4j(cls, record: "neo4j.Record", *, key: str = "task") -> Task:
return cls(**node)

@classmethod
def postgres_row_factory(cls, cursor: BaseCursor[Any, Any]) -> RowMaker[Task]:
def postgres_row_factory(cls, cursor: "BaseCursor[Any, Any]") -> "RowMaker[Task]":

def as_row(values: Sequence[Any]) -> Task:
as_dict = {
Expand Down Expand Up @@ -548,8 +546,8 @@ def from_neo4j(

@classmethod
def postgres_row_factory(
cls, cursor: BaseCursor[Any, Any]
) -> RowMaker[ResultEvent]:
cls, cursor: "BaseCursor[Any, Any]"
) -> "RowMaker[ResultEvent]":
def as_row(values: Sequence[Any]) -> ResultEvent:
# pylint: disable=c-extension-no-member
import ujson
Expand Down Expand Up @@ -613,7 +611,9 @@ def from_neo4j(
)

@classmethod
def postgres_row_factory(cls, cursor: BaseCursor[Any, Any]) -> RowMaker[ErrorEvent]:
def postgres_row_factory(
cls, cursor: "BaseCursor[Any, Any]"
) -> "RowMaker[ErrorEvent]":
def as_row(values: Sequence[Any]) -> cls:
# pylint: disable=c-extension-no-member
import ujson
Expand Down