Ian OLeary
03/25/2024, 4:00 PMAttributeError: 'list' object has no attribute 'items'
So I'm getting this error for one of my API endpoints for my custom tap. Most endpoints come back as a list of dictionaries [["column_1_name": "column_1_value", "column_2_name": "column_2_value", etc...]], but this one comes back as a list of lists with the data as [["column_1_name", "column_2_name"],["column_1_value", "column_2_value"]]. Is that what may be causing this error? If so do I need to redeclare the records_jsonpath
property for that particular stream?Edgar Ramírez (Arch.dev)
03/25/2024, 4:09 PMIf so do I need to redeclare theFor that stream it might be easier to override RESTStream.parse_response than to figure out the right jsonpath expression 😅. Maybeproperty for that particular stream?records_jsonpath
def parse_response(self, response):
data = response.json()
field_names = data[0]
for row in data[1:]:
yield dict(zip(field_names, row))
or something like thatIan OLeary
03/25/2024, 4:11 PM