Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1569916: fix local testing default timestamp timezone issue #2114

Merged
merged 5 commits into from
Aug 22, 2024

Conversation

sfc-gh-aling
Copy link
Contributor

@sfc-gh-aling sfc-gh-aling commented Aug 16, 2024

  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-1569916

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
  3. Please describe how your code solves the related issue.

in snowflake, the default timestamp type is controlled by the session parameter TIMESTAMP_TYPE_MAPPING:
https://docs.snowflake.com/en/sql-reference/parameters#label-timestamp-type-mapping

in local testing, we didn't have this testing, leaving the default timestamp type timezone information is empty.
this leads to incorrect behavior when users are using convert_timezone method.

this PR introduces a private module variable TIMESTAMP_TYPE_MAPPING as a temporary workaround to align with the default snowflake behavior -- when to_timestamp is called, the timestamp should have timezone type being NTZ.

this PR also added coercion for default timezone type and NTZ timezone type.

@github-actions github-actions bot added the local testing Local Testing issues/PRs label Aug 16, 2024
@sfc-gh-aling sfc-gh-aling changed the title SNOW-1569916: fix timezone issue SNOW-1569916: fix local testing default timestamp timezone issue Aug 16, 2024
@sfc-gh-aling sfc-gh-aling marked this pull request as ready for review August 16, 2024 22:34
@sfc-gh-aling sfc-gh-aling requested a review from a team as a code owner August 16, 2024 22:34
CHANGELOG.md Outdated Show resolved Hide resolved
@sfc-gh-aling sfc-gh-aling merged commit 70310ea into main Aug 22, 2024
34 checks passed
@sfc-gh-aling sfc-gh-aling deleted the SNOW-1569916-bug-convert-timezone-issue branch August 22, 2024 21:42
@github-actions github-actions bot locked and limited conversation to collaborators Aug 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
local testing Local Testing issues/PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants