Skip to content

Commit

Permalink
Make mypy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Sep 9, 2024
1 parent 113ac33 commit ed355c8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
5 changes: 4 additions & 1 deletion tap_hookdeck/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
from singer_sdk.authenticators import APIKeyAuthenticator
from singer_sdk.helpers._typing import TypeConformanceLevel

if t.TYPE_CHECKING:
from singer_sdk.helpers.types import Context


class HookdeckStream(RESTStream[str]):
"""Hookdeck stream class."""
Expand Down Expand Up @@ -44,7 +47,7 @@ def http_headers(self) -> dict[str, str]:

def get_url_params(
self,
context: dict[str, t.Any] | None,
context: Context | None,
next_page_token: str | None,
) -> dict[str, t.Any]:
"""Get URL query parameters.
Expand Down
26 changes: 15 additions & 11 deletions tap_hookdeck/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

from __future__ import annotations

from typing import Any, ClassVar
import typing as t

from singer_sdk import typing as th

from tap_hookdeck.client import HookdeckStream

DESTINATION: list[th.Property[Any]] = [
if t.TYPE_CHECKING:
from singer_sdk.helpers.types import Context


DESTINATION: list[th.Property[t.Any]] = [
th.Property("id", th.StringType, required=True),
th.Property("name", th.StringType, required=True),
th.Property("description", th.StringType),
Expand Down Expand Up @@ -41,7 +45,7 @@
th.Property("disabled_at", th.DateTimeType),
]

SOURCE: list[th.Property[Any]] = [
SOURCE: list[th.Property[t.Any]] = [
th.Property("id", th.StringType, required=True),
th.Property("name", th.StringType, required=True),
th.Property("description", th.StringType),
Expand Down Expand Up @@ -86,7 +90,7 @@ class Connections(HookdeckStream):

name = "connections"
path = "/2023-07-01/connections"
primary_keys: ClassVar[list[str]] = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]

# Incremental not supported
replication_key = None
Expand Down Expand Up @@ -122,9 +126,9 @@ def is_sorted(self) -> bool:

def get_url_params(
self,
context: dict[str, Any] | None,
context: Context | None,
next_page_token: str | None,
) -> dict[str, Any]:
) -> dict[str, t.Any]:
"""Get URL query parameters."""
params = super().get_url_params(context, next_page_token)
params["archived"] = True
Expand All @@ -136,7 +140,7 @@ class Destinations(HookdeckStream):

name = "destinations"
path = "/2023-07-01/destinations"
primary_keys: ClassVar[list[str]] = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]

# Incremental not supported
replication_key = None
Expand All @@ -152,7 +156,7 @@ class Sources(HookdeckStream):

name = "sources"
path = "/2023-07-01/sources"
primary_keys: ClassVar[list[str]] = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]

# Incremental not supported
replication_key = None
Expand All @@ -168,7 +172,7 @@ class IssueTriggers(HookdeckStream):

name = "issue_triggers"
path = "/2023-07-01/issue-triggers"
primary_keys: ClassVar[list[str]] = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]

# Incremental not supported
replication_key = None
Expand Down Expand Up @@ -209,7 +213,7 @@ class Transformations(HookdeckStream):

name = "transformations"
path = "/2023-07-01/transformations"
primary_keys: ClassVar[list[str]] = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]

# Incremental not supported
replication_key = None
Expand All @@ -233,7 +237,7 @@ class Requests(HookdeckStream):

name = "requests"
path = "/2023-07-01/requests"
primary_keys: ClassVar[list[str]] = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]

# Incremental not supported
replication_key = "ingested_at"
Expand Down

0 comments on commit ed355c8

Please sign in to comment.