diff --git a/singer_sdk/mapper.py b/singer_sdk/mapper.py index a0de52e01..c222acc67 100644 --- a/singer_sdk/mapper.py +++ b/singer_sdk/mapper.py @@ -359,7 +359,7 @@ def _eval( return result - def _eval_type( + def _eval_type( # noqa: PLR0911 self, expr: str, default: th.JSONTypeHelper | None = None, @@ -398,6 +398,12 @@ def _eval_type( if expr.startswith("bool("): return th.BooleanType() + if expr.startswith("datetime.date") or expr.endswith(".date()"): + return th.DateType() + + if expr.startswith("datetime.datetime"): + return th.DateTimeType() + return th.StringType() if expr[0] == "'" and expr[-1] == "'" else default def _init_functions_and_schema( # noqa: PLR0912, PLR0915, C901