Christopher Wu
02/16/2022, 11:27 PM_scan_schema
because the subschema is being read as a list. Not sure if the required key should be included but it is.
subschema = [{'properties': {'Connector': {'type': 'string'}, 'Current': {'type': 'string'}, 'Description': {'type': ['null', 'str... ...}, 'required': ['portNumber', 'stationName', 'Geo', 'Description', 'Reservable', 'Status', ...], 'type': 'object'}]
path = '/Port/[]'
def _scan_schema(subschema, path=""):
if "oneOf" in subschema or "anyOf" in subschema:
if annotate_one_of:
return [
_scan_schema({"type": "object", **s}, path + f"({num})")
for num, s in enumerate(subschema.get("oneOf") or subschema.get("anyOf"))
]
return [_scan_schema({"type": "object", **s}, path) for s in subschema.get("oneOf") or subschema.get("anyOf")]
> schema_type = subschema.get("type", ["null"])
E AttributeError: 'list' object has no attribute 'get'
../../bases/source-acceptance-test/source_acceptance_test/utils/json_schema_helper.py:194: AttributeError
Is this an issue with my configured catalog?Nathan Gille
02/17/2022, 2:49 AMAakash Kumar
02/17/2022, 2:56 PM{
"streams": [
{
"stream": {
"name": "getChargingSessionData",
"json_schema": {
"type": "object",
"title": "getChargingSessionData",
"description": "Event level charging data",
"properties": {
"stationID": {
"type": "string"
},
"stationName": {
"type": "string"
},
"portNumber": {
"type": "string"
},
"Address": {
"type": "string"
},
"City": {
"type": "string"
},
"State": {
"type": "string"
},
"Country": {
"type": "string"
},
"postalCode": {
"type": "string"
},
"sessionID": {
"type": "integer"
},
"Energy": {
"type": "number"
},
"startTime": {
"type": "string"
},
"endTime": {
"type": "string"
},
"userID": {
"type": [
"null",
"integer"
]
},
"recordNumber": {
"type": "integer"
},
"credentialID": {
"type": "string"
}
}
},
"supported_sync_modes": [
"full_refresh",
"incremental"
],
"source_defined_cursor": true,
"default_cursor_field": [
"recordNumber"
]
},
"sync_mode": "incremental",
"cursor_field": [
"recordNumber"
],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "getStations",
"json_schema": {
"type": "object",
"title": "getStations",
"description": "Station List",
"properties": {
"stationID": {
"type": "string"
},
"stationManufacturer": {
"type": "string"
},
"stationModel": {
"type": "string"
},
"stationMacAddr": {
"type": "string"
},
"stationSerialNum": {
"type": "string"
},
"stationActivationDate": {
"type": "string",
"format": "date-time"
},
"Address": {
"type": "string"
},
"City": {
"type": "string"
},
"State": {
"type": "string"
},
"Country": {
"type": "string"
},
"postalCode": {
"type": "string"
},
"Port": {
"type": "object",
"properties": {
"portNumber": {
"type": "string"
},
"stationName": {
"type": "string"
},
"Geo": {
"type": "object",
"properties": {
"Lat": {
"type": "string"
},
"Long": {
"type": "string"
}
}
},
"Description": {
"type": [
"null",
"string"
]
},
"Reservable": {
"type": "integer"
},
"Status": {
"type": [
"null",
"string"
]
},
"Level": {
"type": "string"
},
"timeStamp": {
"type": [
"null",
"string"
],
"format": "date-time"
},
"Mode": {
"type": [
"null",
"string"
]
},
"Connector": {
"type": "string"
},
"Voltage": {
"type": "string"
},
"Current": {
"type": "string"
},
"Power": {
"type": "string"
},
"estimatedCost": {
"type": "number"
}
}
}
}
},
"supported_sync_modes": [
"full_refresh"
],
"source_defined_cursor": false
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}