Hi hi, I'm having a bit of trouble figuring out wh...
# troubleshooting
h
Hi hi, I'm having a bit of trouble figuring out what the problem is. I'm making a test custom extractor just to get use to this. I'm getting this error: FAILED tests/test_core.py:TestTapDogsAPI:test_tap_stream_primary_keys[breeds] - KeyError: 'id' 🤔 This is my streams.py config:
Copy code
"""Stream type classes for tap-dogsapi."""

from __future__ import annotations

import sys
import typing as t

from singer_sdk import typing as th  # type: ignore # JSON Schema typing helpers

from tap_dogsapi.client import DogsAPIStream

if sys.version_info >= (3, 9):
    import importlib.resources as importlib_resources
else:
    import importlib_resources

class BreedStream(DogsAPIStream):
    """Define custom stream."""

    name = "breeds"
    path = "/breeds"
    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
    schema = th.PropertiesList(
        th.Property(
            "id",
            th.StringType,
            description="The breed's system ID",
        ),
        th.Property(
            "breed",
            th.StringType,
            description="The breed of the dog",
        ),
        th.Property(
            "attributes",
            th.ObjectType(
                th.Property("name",th.StringType),
                th.Property("description", th.StringType),
                th.Property("hypoallergenic",th.BooleanType),
            )
        ),
    ).to_dict()
This is the Api url in client.py
Copy code
class DogsAPIStream(RESTStream):
    """DogsAPI stream class."""

    @property
    def url_base(self) -> str:
        """Return the API URL root, configurable via tap settings."""
        return "<https://dogapi.dog/api/v2>"
e
You might wanna update
records_jsonpath
in your client class
1
h
aah thank you so much for the help still quite new to programming in general so learning a lot of new stuff. I changed it now I have 10 passes 🙂
Copy code
records_jsonpath = "$['data'][*]"
🙌 2
v
Also you want to see the full stack trace and learn how to read those as it'll point you closer to where the issue actually is happening at (jsonpath can be a bit tricky with the stack trace)
🙏 1