From 2196af54401f5119abfe583d6316a26225f398e9 Mon Sep 17 00:00:00 2001 From: Benjamin Theunissen Date: Tue, 21 Nov 2023 20:51:27 -0500 Subject: [PATCH] List to json --- pyproject.toml | 2 +- target_clickhouse/sinks.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 94116a7..5cc76d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "shaped-target-clickhouse" -version = "0.1.19" +version = "0.1.20" description = "`target-clickhouse` is a Singer target for clickhouse, built with the Meltano Singer SDK." readme = "README.md" authors = ["Ben Theunissen"] diff --git a/target_clickhouse/sinks.py b/target_clickhouse/sinks.py index 924ab8b..fe0bad3 100644 --- a/target_clickhouse/sinks.py +++ b/target_clickhouse/sinks.py @@ -83,7 +83,7 @@ def bulk_insert_records( # Need to convert any records with a dict type to a JSON string. for record in records: for key, value in record.items(): - if isinstance(value, dict): + if isinstance(value, (dict, list)): record[key] = json.dumps(value) return super().bulk_insert_records(full_table_name, schema, records)