Snowflake-Labs / django-snowflake

MIT License
61 stars 16 forks source link

Datetime should be Timestamp_ntz #73

Closed Ajith-Raja closed 1 year ago

Ajith-Raja commented 1 year ago

https://github.com/Snowflake-Labs/django-snowflake/blob/25c603482b39109509eb2a549672cd9404e5dc6c/django_snowflake/base.py#L32

timestamp_ltz is converting the time and inserting, whereas timestamp_ntz inserts the time as it is, so better use timestamp_ntz. Is there any reason in using timestamp_ltz.

timgraham commented 1 year ago

TIMESTAMP_LTZ is used for Django's time zone support (946126895d27d4e49da833c6e0449e1a0567b3d0).

Are you encountering a specific problem?

Ajith-Raja commented 1 year ago

Yes is is something like converting the passed datetime to other timezone when inserting

Ajith-Raja commented 1 year ago

so we are dropping the column and creating with timestamp_ntz manually

can you pls check with TIMESTAMP_NTZ

timgraham commented 1 year ago

Django's time zone support isn't possible with TIMESTAMP_NTZ. Can you provide a minimal sample Django project with a failing test case that demonstrates your problem? Django's own test suite has many time zone tests and they are all passing with the current implementation.

Ajith-Raja commented 1 year ago

https://docs.snowflake.com/en/sql-reference/data-types-datetime

just saw the doc TIMESTAMP_LTZ internally stores UTC time with a specified precision

timgraham commented 1 year ago

If you think there's a bug, please include steps to reproduce it.

Closing as invalid.