Hi, this is for other python and singer novices. I...
# singer-tap-development
s
Hi, this is for other python and singer novices. I’m writing a tap for clickup. In several of their endpoints, instead of returning an array of results, they return an object with an array corresponding to the endpoint. i.e. for the teams endpoint, they would return:
Copy code
{
    "teams": [
        {...},
        {...}
    ]
}
Some endpoints do it, some don’t. I want to insert the objects in teams[] into Snowflake instead as rows instead of a single row called teams. I worked it out this way: Add
def parse_response()
to my class and
yield
each object in the array with a for loop.
Copy code
def parse_response(self, response) -> Iterable[dict]:
        """Parse Google Analytics API response into individual records."""

        data =response.json().get("teams")
        for team in data:
            yield team