MeltanoLabs / target-athena

Singer.io Target for AWS Athena.
Other
5 stars 16 forks source link

Not all schemas have a type if "string" in property_schema["type"] and property_schema.get("format", None) in { KeyError: 'type' #28

Closed visch closed 2 years ago

visch commented 2 years ago
Traceback (most recent call last):
  File "/home/visch/git/shopify/.meltano/loaders/target-athena/venv/bin/target-athena", line 8, in <module>
    sys.exit(cli())
  File "/home/visch/git/shopify/.meltano/loaders/target-athena/venv/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/visch/git/shopify/.meltano/loaders/target-athena/venv/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/visch/git/shopify/.meltano/loaders/target-athena/venv/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/visch/git/shopify/.meltano/loaders/target-athena/venv/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/visch/git/shopify/.meltano/loaders/target-athena/venv/lib/python3.8/site-packages/singer_sdk/target_base.py", line 382, in cli
    target.listen()
  File "/home/visch/git/shopify/.meltano/loaders/target-athena/venv/lib/python3.8/site-packages/singer_sdk/target_base.py", line 145, in listen
    self._process_lines(sys.stdin)
  File "/home/visch/git/shopify/.meltano/loaders/target-athena/venv/lib/python3.8/site-packages/singer_sdk/target_base.py", line 205, in _process_lines
    self._process_record_message(line_dict)
  File "/home/visch/git/shopify/.meltano/loaders/target-athena/venv/lib/python3.8/site-packages/singer_sdk/target_base.py", line 248, in _process_record_message
    sink._validate_and_parse(transformed_record)
  File "/home/visch/git/shopify/.meltano/loaders/target-athena/venv/lib/python3.8/site-packages/singer_sdk/sinks.py", line 224, in _validate_and_parse
    self._parse_timestamps_in_record(
  File "/home/visch/git/shopify/.meltano/loaders/target-athena/venv/lib/python3.8/site-packages/singer_sdk/sinks.py", line 239, in _parse_timestamps_in_record
    datelike_type = get_datelike_property_type(key, schema["properties"][key])
  File "/home/visch/git/shopify/.meltano/loaders/target-athena/venv/lib/python3.8/site-packages/singer_sdk/helpers/_typing.py", line 105, in get_datelike_property_type
    if "string" in property_schema["type"] and property_schema.get("format", None) in {
KeyError: 'type'
pnadolny13 commented 2 years ago

@visch I created an MR for the SDK which should fix this after we bump the version.