tekumara / fakesnow

Fake Snowflake Connector for Python. Run, mock and test Snowflake DB locally.
Apache License 2.0
83 stars 7 forks source link

feat: cast string literals to timestamp in datediff #79

Closed seruman closed 2 months ago

seruman commented 3 months ago

Basically the same as https://github.com/tekumara/fakesnow/pull/72 but for DATEDIFF.

Same concerns of the DATEADD change applies here;

But I'm a little bit concerned on TIMESTAMP as DuckDB is quite picky operations between TIMESTAMP and TIMESTAMP WITH TIMEZONE. Like; CURRENT_TIMESTAMP returns TIMESTAMP WITH TIMEZONE and DATE_DIFF expects either operands to be same typed. I saw that to_timestamp transformation casts to TIMESTAMP and went with it.

tekumara commented 2 months ago

👍