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)

Open
#782 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug triaged
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.