From 962c1c486d5da8b0c2e412160dbe8617b70d3395 Mon Sep 17 00:00:00 2001 From: dagostinol Date: Wed, 12 Jul 2023 08:03:18 -0400 Subject: [PATCH] black formatting --- target_s3_parquet/data_type_generator.py | 2 +- .../tests/test_data_type_generator.py | 48 ++++--------------- 2 files changed, 11 insertions(+), 39 deletions(-) diff --git a/target_s3_parquet/data_type_generator.py b/target_s3_parquet/data_type_generator.py index 1aa980e..f7e035b 100644 --- a/target_s3_parquet/data_type_generator.py +++ b/target_s3_parquet/data_type_generator.py @@ -25,7 +25,7 @@ def coerce_types(name, type, format=None, description=None): if format == "date-time": return "timestamp" - if description in ["raw","blob"]: + if description in ["raw", "blob"]: return "binary" return type diff --git a/target_s3_parquet/tests/test_data_type_generator.py b/target_s3_parquet/tests/test_data_type_generator.py index 74aa237..0afecf3 100644 --- a/target_s3_parquet/tests/test_data_type_generator.py +++ b/target_s3_parquet/tests/test_data_type_generator.py @@ -20,7 +20,7 @@ def test_schema_with_all_of(): {"type": "string", "format": "date-time"}, {"type": ["string", "null"]}, ] - }, + } } assert generate_tap_schema(schema) == {"lastModifiedDate": "string"} @@ -87,7 +87,7 @@ def test_complex_schema(): "identity_profiles": "array>>>", + + "value:string>>>>" } assert generate_tap_schema(schema) == expected_result @@ -103,11 +103,7 @@ def test_number_type(): "type": ["null", "array"], "items": { "type": ["null", "object"], - "properties": { - "some_value": { - "type": ["null", "number"], - }, - }, + "properties": {"some_value": {"type": ["null", "number"]}}, }, }, } @@ -128,11 +124,7 @@ def test_integer_type(): "type": ["null", "array"], "items": { "type": ["null", "object"], - "properties": { - "some_value": { - "type": ["null", "integer"], - }, - }, + "properties": {"some_value": {"type": ["null", "integer"]}}, }, }, } @@ -173,11 +165,7 @@ def test_only_string_definition(): "type": ["null", "array"], "items": { "type": ["null", "object"], - "properties": { - "some_value": { - "type": ["null", "integer"], - }, - }, + "properties": {"some_value": {"type": ["null", "integer"]}}, }, }, } @@ -190,33 +178,17 @@ def test_only_string_definition(): def test_binary_type(): schema = { - "image": { - "type": ["null", "string"], - "description": "blob" - }, - "free_text": { - "type": ["null", "string"], - "description": "raw" - } + "image": {"type": ["null", "string"], "description": "blob"}, + "free_text": {"type": ["null", "string"], "description": "raw"}, } - assert generate_tap_schema(schema) == { - "image": "binary", - "free_text": "binary" - } + assert generate_tap_schema(schema) == {"image": "binary", "free_text": "binary"} def test_singer_decimal_type(): - schema = { - "measurement": { - "type": ["null", "string"], - "format": "singer.decimal" - } - } + schema = {"measurement": {"type": ["null", "string"], "format": "singer.decimal"}} - assert generate_tap_schema(schema) == { - "measurement": "double" - } + assert generate_tap_schema(schema) == {"measurement": "double"} def test_get_current_schema():