Skip to content

Commit

Permalink
add mypy check and mypy fixes (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarbaugh authored Dec 15, 2024
1 parent a87d87e commit fb05553
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
- name: Check pylint
run: |
uv run pylint tap_productboard/
- name: Check mypy
run: |
uv run mypy tap_productboard/ --explicit-package-bases
pytest:

Expand Down
9 changes: 4 additions & 5 deletions tap_productboard/client.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import json
from functools import cached_property
from pathlib import Path
from typing import Any, Union
from typing import Any, Optional, Union
from urllib.parse import parse_qs, urlparse

from singer_sdk.authenticators import BearerTokenAuthenticator
from singer_sdk.exceptions import FatalAPIError
from singer_sdk.helpers.types import Auth, Context
from singer_sdk.streams import RESTStream
from singer_sdk.streams.rest import _TToken

DEFAULT_API_VERSION = "1"

Expand Down Expand Up @@ -51,7 +50,7 @@ def schema(self) -> dict:
return json.loads(path.read_text())

def get_url_params(
self, context: Context, next_page_token: _TToken
self, context: Optional[Context], next_page_token: Optional[Any]
) -> Union[dict[str, Any], str]:
"""Set the pagination param and the replication param, if applicable."""

Expand All @@ -61,8 +60,8 @@ def get_url_params(
if next_page_token.startswith("https"):
url_parts = urlparse(next_page_token)
if url_parts.query:
params = parse_qs(url_parts.query)
next_page_token = params.get("pageCursor")
o = parse_qs(url_parts.query)
next_page_token = o.get("pageCursor")
params["pageCursor"] = next_page_token

start_datetime = self.get_starting_timestamp(context)
Expand Down

0 comments on commit fb05553

Please sign in to comment.