snowflakedb / snowflakedb/snowpark-python
SNOW-789033: Method cache_result: Expression type does not match column data type, expecting TIMESTAMP_NTZ(9) but got TIMESTAMP_TZ(9)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 341
- Forks
- 155
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 27
Description
Assuming a session is already created, the python code shown below results in the error: "Expression type does not match column data type, expecting TIMESTAMP_NTZ(9) but got TIMESTAMP_TZ(9)".
df = session.sql("select to_timestamp_tz('2022-04-12 09:50:07 +01:00') as time")
display(df.collect())
df.cache_result()
From a quick glance at snowflake.snowpark.types, it contains TimestampType, which seems to be the equivalent of Snowflakes TIMESTAMP_NTZ. I therefore assume that TIMESTAMP_TZ and TIMESTAMP_LTZ are not supported yet, causing this error.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with snowpark.types and the cache_result path, then reproduce the provided Python and SQL example using TIMESTAMP_TZ. Done means the example no longer reports a TIMESTAMP_NTZ mismatch and the supported timestamp handling is covered by the relevant tests, if present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100