singer-io / singer-python

Writes the Singer format from Python
https://singer.io
Apache License 2.0
542 stars 130 forks source link

Fix/error reporting in parsing #72

Closed dmosorast closed 6 years ago

dmosorast commented 6 years ago

In the case that a value comes through as None or '' (empty string) for a datetime schema, the transformer was logging an error level log line, while this case was actually being parsed successfully to None (null) if the schema is marked nullable.

This short circuits datetime parsing in the case that None or '' get passed in as a value to avoid this message, and improves the log message on parse failure by reducing the level to warning and providing the failed value in parentheses after the message.

The message was made warning since the schema may have fallbacks that will cause the field to parse successfully (like anyOf with a datetime and a raw string type included).