Skip to content

Commit

Permalink
Fix lookup type (#77)
Browse files Browse the repository at this point in the history
* Fix

* Fix

* Fix
  • Loading branch information
BTheunissen authored Nov 21, 2023
1 parent e85db19 commit 98637d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "shaped-target-clickhouse"
version = "0.1.9"
version = "0.1.10"
description = "`target-clickhouse` is a Singer target for clickhouse, built with the Meltano Singer SDK."
readme = "README.md"
authors = ["Ben Theunissen"]
Expand Down
4 changes: 4 additions & 0 deletions target_clickhouse/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ def _pre_validate_for_string_type(self, record: dict) -> dict:
for key, value in record.items():
# Checking if the schema expects a string for this key.
expected_type = self.schema.get("properties", {}).get(key, {}).get("type")
if expected_type is None:
continue
if not isinstance(expected_type, list):
expected_type = [expected_type]
if "string" in expected_type and not isinstance(value, str):
# Convert the value to string if it's not already a string.
record[key] = (
Expand Down

0 comments on commit 98637d3

Please sign in to comment.