Skip to content

The zendesk-chat tap sent a schema message that caused an error to be thrown #13

@benekastah

Description

@benekastah

First of all, thanks for this target! It's really handy. I'm having trouble using it with the zendesk-chat tap though. Here are the relevant details:

Traceback:

Traceback (most recent call last):
  File "target-venv/bin/target-postgres", line 11, in <module>
    sys.exit(main())
  File "/app/target-venv/lib/python3.7/site-packages/target_postgres/__init__.py", line 138, in main
    state = persist_lines(config, input)
  File "/app/target-venv/lib/python3.7/site-packages/target_postgres/__init__.py", line 100, in persist_lines
    stream_to_sync[stream] = DbSync(config, o)
  File "/app/target-venv/lib/python3.7/site-packages/target_postgres/db_sync.py", line 103, in __init__
    self.flatten_schema = flatten_schema(stream_schema_message['schema'])
  File "/app/target-venv/lib/python3.7/site-packages/target_postgres/db_sync.py", line 63, in flatten_schema
    items.extend(flatten_schema(v, parent_key + [k], sep=sep).items())
  File "/app/target-venv/lib/python3.7/site-packages/target_postgres/db_sync.py", line 59, in flatten_schema
    for k, v in d['properties'].items():
KeyError: 'properties'

The offending schema message:

{"type": "SCHEMA", "stream": "chats", "schema": {"properties": {"department_id": {"type": ["null", "integer"]}, "comment": {"type": ["null", "string"]}, "missed": {"type": ["null", "boolean"]}, "rating": {"type": ["null", "string"]}, "conversions": {"items": {"properties": {"id": {"type": ["string"]}, "goal_name": {"type": ["null", "string"]}, "goal_id": {"type": ["null", "integer"]}, "attribution": {"properties": {"chat_timestamp": {"type": ["null", "string"], "format": "date-time"}, "department_name": {"type": ["null", "string"]}, "agent_name": {"type": ["null", "string"]}, "department_id": {"type": ["null", "integer"]}, "agent_id": {"type": ["null", "integer"]}}, "type": ["null", "object"]}, "timestamp": {"type": ["null", "string"], "format": "date-time"}}, "type": ["null", "object"], "additionalProperties": true}, "type": ["null", "array"]}, "type": {"type": ["null", "string"]}, "webpath": {"items": {"properties": {"to": {"type": ["null", "string"]}, "title": {"type": ["null", "string"]}, "from": {"type": ["null", "string"]}, "timestamp": {"type": ["null", "string"], "format": "date-time"}}, "type": ["null", "object"], "additionalProperties": false}, "type": ["null", "array"]}, "triggered": {"type": ["null", "boolean"]}, "message": {"type": ["null", "string"]}, "referrer_search_terms": {"type": ["null", "string"]}, "referrer_search_engine": {"type": ["null", "string"]}, "zendesk_ticket_id": {"type": ["null", "integer"]}, "unread": {"type": ["null", "boolean", "integer"]}, "timestamp": {"type": ["null", "string"], "format": "date-time"}, "end_timestamp": {"type": ["null", "string"], "format": "date-time"}, "response_time": {"properties": {"first": {"type": ["null", "integer"]}, "max": {"type": ["null", "integer"]}, "avg": {"type": ["null", "number", "integer"]}}, "type": ["null", "object"], "additionalProperties": false}, "session": {"type": ["null", "object"], "additionalProperties": true}, "history": {"items": {"properties": {"name": {"type": ["null", "string"]}, "channel": {"type": ["null", "string"]}, "conversion": {"properties": {"id": {"type": ["string"]}, "goal_name": {"type": ["null", "string"]}, "goal_id": {"type": ["null", "integer"]}, "attribution": {"properties": {"chat_timestamp": {"type": ["null", "string"], "format": "date-time"}, "department_name": {"type": ["null", "string"]}, "agent_name": {"type": ["null", "string"]}, "department_id": {"type": ["null", "integer"]}, "agent_id": {"type": ["null", "integer"]}}, "type": ["null", "object"]}, "timestamp": {"type": ["null", "string"], "format": "date-time"}}, "type": ["null", "object"], "additionalProperties": true}, "timestamp": {"type": ["null", "string"], "format": "date-time"}, "msg": {"type": ["null", "string"]}, "nick": {"type": ["null", "string"]}, "type": {"type": ["null", "string"]}, "options": {"type": ["null", "string"]}, "department_id": {"type": ["null", "integer", "string"]}, "prev_department_id": {"type": ["null", "integer", "string"]}, "department_name": {"type": ["null", "string"]}, "msg_id": {"type": ["null", "string", "integer"]}, "tags": {"type": ["null", "array"]}, "new_tags": {"type": ["null", "array"]}, "rating": {"type": ["null", "string"]}, "new_rating": {"type": ["null", "string"]}, "skills_name": {"type": ["null", "array"]}}, "type": ["null", "object"], "additionalProperties": true}, "type": ["null", "array"]}, "agent_names": {"items": {"type": ["string"]}, "type": ["null", "array"]}, "tags": {"items": {"type": ["string"]}, "type": ["null", "array"]}, "visitor": {"properties": {"name": {"type": ["null", "string"]}, "id": {"type": ["string"]}, "email": {"type": ["null", "string"]}, "notes": {"type": ["null", "string"]}, "phone": {"type": ["null", "string"]}}, "type": ["null", "object"], "additionalProperties": false}, "started_by": {"type": ["null", "string"]}, "triggered_response": {"type": ["null", "boolean"]}, "id": {"type": ["null", "string"]}, "count": {"properties": {"total": {"type": ["null", "integer"]}, "agent": {"type": ["null", "integer"]}, "visitor": {"type": ["null", "integer"]}}, "type": ["null", "object"], "additionalProperties": false}, "agent_ids": {"items": {"type": ["string"]}, "type": ["null", "array"]}, "department_name": {"type": ["null", "string"]}, "duration": {"type": ["null", "integer"]}}, "additionalProperties": false, "type": ["null", "object"]}, "key_properties": ["id"]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions