Skip to content

Commit

Permalink
Simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Sep 28, 2023
1 parent d3eb521 commit 6fa9cf4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion singer_sdk/sinks/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def _parse_timestamps_in_record(
"""
for key, value in record.items():
if key not in schema["properties"]:
self.logger.debug("No schema for record field '%s'", key)
self.logger.warning("No schema for record field '%s'", key)
continue
datelike_type = get_datelike_property_type(schema["properties"][key])
if datelike_type:
Expand Down
18 changes: 6 additions & 12 deletions tests/core/sinks/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,14 @@ def test_validate_record():
["id"],
)

record_message = {
"type": "RECORD",
"stream": "users",
"record": {
"id": 1,
"created_at": "2021-01-01T00:00:00+00:00",
"missing_datetime": "2021-01-01T00:00:00+00:00",
"invalid_datetime": "not a datetime",
},
"time_extracted": "2021-01-01T00:00:00+00:00",
"version": 100,
record = {
"id": 1,
"created_at": "2021-01-01T00:00:00+00:00",
"missing_datetime": "2021-01-01T00:00:00+00:00",
"invalid_datetime": "not a datetime",
}
record = record_message["record"]
updated_record = sink._validate_and_parse(record)

assert updated_record["created_at"] == datetime.datetime(
2021,
1,
Expand Down

0 comments on commit 6fa9cf4

Please sign in to comment.