Skip to content

Commit

Permalink
Set to NULL on error of datetime parse
Browse files Browse the repository at this point in the history
  • Loading branch information
BTheunissen committed Nov 21, 2023
1 parent f3f6ed5 commit 0106786
Show file tree
Hide file tree
Showing 2 changed files with 9 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.10"
version = "0.1.11"
description = "`target-clickhouse` is a Singer target for clickhouse, built with the Meltano Singer SDK."
readme = "README.md"
authors = ["Ben Theunissen"]
Expand Down
8 changes: 8 additions & 0 deletions target_clickhouse/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import simplejson as json
import sqlalchemy
from pendulum import now
from singer_sdk.helpers._typing import (
DatetimeErrorTreatmentEnum,
)
from singer_sdk.sinks import SQLSink
from sqlalchemy.sql.expression import bindparam

Expand Down Expand Up @@ -52,6 +55,11 @@ def full_table_name(self) -> str:
db_name=self.database_name,
)

@property
def datetime_error_treatment(self) -> DatetimeErrorTreatmentEnum:
"""Return a treatment to use for datetime parse errors: ERROR. MAX, or NULL."""
return DatetimeErrorTreatmentEnum.NULL

def bulk_insert_records(
self,
full_table_name: str,
Expand Down

0 comments on commit 0106786

Please sign in to comment.