Skip to content

Commit 099951c

Browse files
committed
estuary-cdk: specify PageCursor type parameters
Some linters complain about the `dict` variant in the PageCursor definition not having any type parameters set. `str` has been picked for the key, as that's what all connectors currently use. `JsonValue` is used for values, PageCursors need to be JSON serialisable.
1 parent 63cc47b commit 099951c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

estuary-cdk/estuary_cdk/capture/common.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
Literal,
1919
TypeVar,
2020
)
21-
from pydantic import AwareDatetime, BaseModel, Field, NonNegativeInt
21+
22+
from pydantic import AwareDatetime, BaseModel, Field, JsonValue, NonNegativeInt
2223

2324
from ..cron import next_fire
2425
from ..utils import json_merge_patch
@@ -102,7 +103,7 @@ def pop_cursor_marker(cursor: dict) -> dict:
102103
return cursor
103104

104105

105-
PageCursor = str | int | dict | None
106+
PageCursor = str | int | dict[str, JsonValue] | None
106107
"""PageCursor is a cursor into a paged result set.
107108
These cursors are predominantly an opaque string or an internal offset integer.
108109
When a dict is used, it represents a structured cursor that supports JSON merge patches

0 commit comments

Comments
 (0)