Skip to content

Commit

Permalink
Address dynamic class attributes and TODO comments
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Aug 1, 2023
1 parent e0b4e0d commit be80c3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import typing as t
from pathlib import Path

from singer_sdk import typing as th # JSON Schema typing helpers
Expand Down Expand Up @@ -54,7 +55,7 @@ class UsersStream({{ cookiecutter.source_name }}Stream):
),
),
).to_dict()
primary_keys = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]
replication_key = None
graphql_query = """
users {
Expand All @@ -81,7 +82,7 @@ class GroupsStream({{ cookiecutter.source_name }}Stream):
th.Property("id", th.StringType),
th.Property("modified", th.DateTimeType),
).to_dict()
primary_keys = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]
replication_key = "modified"
graphql_query = """
groups {
Expand All @@ -104,7 +105,7 @@ class UsersStream({{ cookiecutter.source_name }}Stream):
{%- if cookiecutter.stream_type == "REST" %}
path = "/users"
{%- endif %}
primary_keys = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]
replication_key = None
# Optionally, you may also use `schema_filepath` in place of `schema`:
# schema_filepath = SCHEMAS_DIR / "users.json" # noqa: ERA001
Expand Down Expand Up @@ -143,7 +144,7 @@ class GroupsStream({{ cookiecutter.source_name }}Stream):
{%- if cookiecutter.stream_type == "REST" %}
path = "/groups"
{%- endif %}
primary_keys = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]
replication_key = "modified"
schema = th.PropertiesList(
th.Property("name", th.StringType),
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

RUFF_OVERRIDES = """\
extend = "./pyproject.toml"
extend-ignore = ["TD002", "TD003"]
extend-ignore = ["TD002", "TD003", "FIX002"]
"""

COOKIECUTTER_REPLAY_FILES = list(Path("./e2e-tests/cookiecutters").glob("*.json"))
Expand Down

0 comments on commit be80c3b

Please sign in to comment.