From b02111546c10a406d5499cb9c8f7292280f6d184 Mon Sep 17 00:00:00 2001 From: Ben Theunissen Date: Tue, 28 Nov 2023 09:50:54 -0500 Subject: [PATCH] Fix None parsing (#83) * Fix None parsing * Fix lint --- pyproject.toml | 3 ++- target_clickhouse/sinks.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5cc76d5..02a007b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "shaped-target-clickhouse" -version = "0.1.20" +version = "0.1.21" description = "`target-clickhouse` is a Singer target for clickhouse, built with the Meltano Singer SDK." readme = "README.md" authors = ["Ben Theunissen"] @@ -49,6 +49,7 @@ ignore = [ "TCH003", "ANN202", "C901", + "TRY201", # Use of bare 'except' ] select = ["ALL"] src = ["target_clickhouse"] diff --git a/target_clickhouse/sinks.py b/target_clickhouse/sinks.py index fe0bad3..50d4508 100644 --- a/target_clickhouse/sinks.py +++ b/target_clickhouse/sinks.py @@ -199,6 +199,9 @@ def pre_validate_for_string_type( if not isinstance(expected_type, list): expected_type = [expected_type] + if "null" in expected_type and value is None: + continue + if "object" in expected_type and isinstance(value, dict): pre_validate_for_string_type( value,