Skip to content

Commit

Permalink
Use raw schema for raw record
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Sep 22, 2023
1 parent 2f73837 commit ac0d017
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion singer_sdk/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def _eval_type(

# If a field is set to "record", then it should be an "object" in the schema
if expr == "record":
return th.ObjectType()
return self.raw_schema

if expr.startswith("float("):
return th.NumberType()
Expand Down
2 changes: 1 addition & 1 deletion tests/snapshots/mapped_stream/record_to_column.jsonl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{"type": "STATE", "value": {}}
{"type": "SCHEMA", "stream": "mystream", "schema": {"type": "object", "properties": {"_data": {"type": ["object", "null"], "properties": {}}}}, "key_properties": []}
{"type": "SCHEMA", "stream": "mystream", "schema": {"type": "object", "properties": {"_data": {"properties": {"email": {"type": ["string", "null"]}, "count": {"type": ["integer", "null"]}, "user": {"properties": {"id": {"type": ["integer", "null"]}, "sub": {"properties": {"num": {"type": ["integer", "null"]}}, "type": ["object", "null"]}, "some_numbers": {"items": {"type": ["number"]}, "type": ["array", "null"]}}, "type": ["object", "null"]}}, "type": ["object", "null"]}}}, "key_properties": []}
{"type": "RECORD", "stream": "mystream", "record": {"_data": {"email": "alice@example.com", "count": 21, "user": {"id": 1, "sub": {"num": 1}, "some_numbers": [3.14, 2.718]}}}, "time_extracted": "2022-01-01T00:00:00+00:00"}
{"type": "RECORD", "stream": "mystream", "record": {"_data": {"email": "bob@example.com", "count": 13, "user": {"id": 2, "sub": {"num": 2}, "some_numbers": [10.32, 1.618]}}}, "time_extracted": "2022-01-01T00:00:00+00:00"}
{"type": "RECORD", "stream": "mystream", "record": {"_data": {"email": "charlie@example.com", "count": 19, "user": {"id": 3, "sub": {"num": 3}, "some_numbers": [1.414, 1.732]}}}, "time_extracted": "2022-01-01T00:00:00+00:00"}
Expand Down

0 comments on commit ac0d017

Please sign in to comment.