Skip to content

Commit

Permalink
🧪 re-isolate static test fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
z3z1ma committed Mar 15, 2023
1 parent 2547b4f commit 313972c
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions target_bigquery/tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
{"type": "RECORD", "stream": "{stream_name}", "record": {"id": 2, "rep_key": 2, "Col_2_string": "45d8f187-3776-46bc-bbba-195f70455b0d", "Col_3_datetime": "2022-11-11T13:40:56.807414+00:00", "Col_4_int": 1496147986, "Col_5_float": 0.6505589093769572, "Col_6_string": "e17c9332-531c-44fd-89d7-d71bb3071a4c", "Col_7_datetime": "2022-11-11T13:40:56.807419+00:00", "Col_8_int": 1483639242, "Col_9_float": 0.14177466670396877, "Col_10_string": "8ea89b6d-030b-4884-b2f3-aa7cb3f84a32", "Col_11_datetime": "2022-11-11T13:40:56.807425+00:00", "Col_12_int": 281713617, "Col_13_float": 0.9128294678949099, "Col_14_string": "b8c0287a-cb3b-471c-a73f-ddbbd46def96", "Col_15_datetime": "2022-11-11T13:40:56.807430+00:00", "Col_16_int": 1676536646, "Col_17_float": 0.20444489249202114, "Col_18_string": "3078fa1b-0d35-4393-a1bc-e005dde62494", "Col_19_datetime": "2022-11-11T13:40:56.807435+00:00", "Col_20_int": 1596646895, "Col_21_float": 0.13991626696903536, "Col_22_string": "5d033520-2214-4ab4-a586-09d9939fa8d0", "Col_23_datetime": "2022-11-11T13:40:56.807440+00:00", "Col_24_int": 339609379, "Col_25_float": 0.7179419896107613, "Col_26_string": "8c39c287-f4d7-4781-a7ed-6f87124866b6", "Col_27_datetime": "2022-11-11T13:40:56.807445+00:00", "Col_28_int": 1815034575, "Col_29_float": 0.9522143006195518}, "time_extracted": "2022-11-11T20:40:56.807796+00:00"}
{"type": "RECORD", "stream": "{stream_name}", "record": {"id": 3, "rep_key": 3, "Col_2_string": "19a9ceb8-9bda-46a0-9a19-f9117be34ddf", "Col_3_datetime": "2022-11-11T13:40:56.807910+00:00", "Col_4_int": 1957217254, "Col_5_float": 0.43289496913069425, "Col_6_string": "53ed2273-48d6-4182-9717-6d0af51e6ad9", "Col_7_datetime": "2022-11-11T13:40:56.807916+00:00", "Col_8_int": 1672454615, "Col_9_float": 0.45849249733339414, "Col_10_string": "e60b231d-5de8-4cdf-afa7-d591a60f0207", "Col_11_datetime": "2022-11-11T13:40:56.807921+00:00", "Col_12_int": 620242020, "Col_13_float": 0.12772702726587115, "Col_14_string": "4a00041b-e71b-4832-8188-9b35b4025d57", "Col_15_datetime": "2022-11-11T13:40:56.807926+00:00", "Col_16_int": 869791103, "Col_17_float": 0.7034707479613156, "Col_18_string": "9be8dbd7-71e9-4af6-8d6b-55badc74042e", "Col_19_datetime": "2022-11-11T13:40:56.807931+00:00", "Col_20_int": 1158691101, "Col_21_float": 0.961251074216243, "Col_22_string": "3488df2c-761b-4910-9a4f-8541517a577c", "Col_23_datetime": "2022-11-11T13:40:56.807936+00:00", "Col_24_int": 1803445752, "Col_25_float": 0.9712573557605182, "Col_26_string": "8b35b130-cc4b-4b13-8c4e-8c68b87b0b46", "Col_27_datetime": "2022-11-11T13:40:56.807941+00:00", "Col_28_int": 152329871, "Col_29_float": 0.07133900568240592}, "time_extracted": "2022-11-11T20:40:56.808289+00:00"}
{"type": "RECORD", "stream": "{stream_name}", "record": {"id": 4, "rep_key": 4, "Col_2_string": "f1fa6590-8b7a-4cfa-ad85-2839d5d358d6", "Col_3_datetime": "2022-11-11T13:40:56.808401+00:00", "Col_4_int": 1840786740, "Col_5_float": 0.8999649085844895, "Col_6_string": "d222b83a-a660-470e-9fa9-838e6240e395", "Col_7_datetime": "2022-11-11T13:40:56.808407+00:00", "Col_8_int": 1300812810, "Col_9_float": 0.4513495007382251, "Col_10_string": "bb719c2d-842b-4d4d-ad09-a8a1e8361218", "Col_11_datetime": "2022-11-11T13:40:56.808412+00:00", "Col_12_int": 451674926, "Col_13_float": 0.7040279698622643, "Col_14_string": "58dd57f6-2511-410e-9a57-3d72da46e569", "Col_15_datetime": "2022-11-11T13:40:56.808417+00:00", "Col_16_int": 1824274251, "Col_17_float": 0.5618479908554109, "Col_18_string": "627e9b1f-5ac2-43d0-8c71-173fe7fcd33f", "Col_19_datetime": "2022-11-11T13:40:56.808422+00:00", "Col_20_int": 1379996338, "Col_21_float": 0.10080587804819452, "Col_22_string": "a21ee366-8cb7-4fb3-8ab4-ae897c72f303", "Col_23_datetime": "2022-11-11T13:40:56.808427+00:00", "Col_24_int": 329557210, "Col_25_float": 0.9385358324655749, "Col_26_string": "b22e4ba1-eb9f-4d2a-8390-6365c3791eb6", "Col_27_datetime": "2022-11-11T13:40:56.808432+00:00", "Col_28_int": 1021771707, "Col_29_float": 0.22978526041580527}, "time_extracted": "2022-11-11T20:40:56.808782+00:00"}
{"type": "SCHEMA", "stream": "{stream_name_2}", "schema": {"properties": {"id": {"type": ["integer", "null"]}, "rep_key": {"type": ["integer", "null"]}}, "type": "object"}, "key_properties": ["id"], "bookmark_properties": ["rep_key"]}
{"type": "RECORD", "stream": "{stream_name_2}", "record": {"id": 0, "rep_key": 0}, "time_extracted": "2022-11-11T20:40:56.806676+00:00"}
{"type": "STATE", "value": {"bookmarks": {"{stream_name_2}": {"starting_replication_value": null, "replication_key": "rep_key", "replication_key_value": 0}}}}
{"type": "RECORD", "stream": "{stream_name_2}", "record": {"id": 1, "rep_key": 1}, "time_extracted": "2022-11-11T20:40:56.807284+00:00"}
{"type": "RECORD", "stream": "{stream_name_2}", "record": {"id": 2, "rep_key": 2}, "time_extracted": "2022-11-11T20:40:56.807796+00:00"}
{"type": "RECORD", "stream": "{stream_name_2}", "record": {"id": 3, "rep_key": 3}, "time_extracted": "2022-11-11T20:40:56.808289+00:00"}
{"type": "RECORD", "stream": "{stream_name_2}", "record": {"id": 4, "rep_key": 4}, "time_extracted": "2022-11-11T20:40:56.808782+00:00"}
""".strip()
SECONDARY_SINGER_STREAM = """
{"type": "SCHEMA", "stream": "{stream_name}", "schema": {"properties": {"id": {"type": ["integer", "null"]}, "rep_key": {"type": ["integer", "null"]}}, "type": "object"}, "key_properties": ["id"], "bookmark_properties": ["rep_key"]}
{"type": "RECORD", "stream": "{stream_name}", "record": {"id": 0, "rep_key": 0}, "time_extracted": "2022-11-11T20:40:56.806676+00:00"}
{"type": "STATE", "value": {"bookmarks": {"{stream_name}": {"starting_replication_value": null, "replication_key": "rep_key", "replication_key_value": 0}}}}
{"type": "RECORD", "stream": "{stream_name}", "record": {"id": 1, "rep_key": 1}, "time_extracted": "2022-11-11T20:40:56.807284+00:00"}
{"type": "RECORD", "stream": "{stream_name}", "record": {"id": 2, "rep_key": 2}, "time_extracted": "2022-11-11T20:40:56.807796+00:00"}
{"type": "RECORD", "stream": "{stream_name}", "record": {"id": 3, "rep_key": 3}, "time_extracted": "2022-11-11T20:40:56.808289+00:00"}
{"type": "RECORD", "stream": "{stream_name}", "record": {"id": 4, "rep_key": 4}, "time_extracted": "2022-11-11T20:40:56.808782+00:00"}
""".strip()


Expand Down Expand Up @@ -55,11 +57,11 @@ def test_basic_sync(method, batch_mode):

singer_input = io.StringIO()
singer_input.write(
BASIC_SINGER_STREAM.replace("{stream_name}", table_name).replace(
"{stream_name_2}", table_name_2
)
"\n".join([
BASIC_SINGER_STREAM.replace("{stream_name}", table_name),
SECONDARY_SINGER_STREAM.replace("{stream_name}", table_name_2),
])
)

singer_input.seek(0)

target = TargetBigQuery(
Expand Down

0 comments on commit 313972c

Please sign in to comment.