Skip to content

feat(snowflake)!: Type annotation for Snowflake LOCALTIMESTAMP#6652

Merged
VaggelisD merged 4 commits intomainfrom
feature/annotatetype-localtimestamp
Jan 7, 2026
Merged

feat(snowflake)!: Type annotation for Snowflake LOCALTIMESTAMP#6652
VaggelisD merged 4 commits intomainfrom
feature/annotatetype-localtimestamp

Conversation

@fivetran-kwoodbeck
Copy link
Collaborator

Maps Snowflake's LOCALTIMESTAMP() to CurrentTimestamp, similar to other timestamp aliases (GETDATE, SYSTIMESTAMP).

Documentation:
https://docs.snowflake.com/en/sql-reference/functions/localtimestamp

Changes:

  • snowflake.py: Add LOCALTIMESTAMP → CurrentTimestamp in FUNCTIONS
  • typing/snowflake.py: Add type annotations for CurrentTimestamp and Localtimestamp returning TIMESTAMPLTZ
  • test_dialect.py: Exclude Snowflake from LOCALTIMESTAMP(n) read tests (can't roundtrip due to alias, test included instead in test_snowflake.py)
  • test_snowflake.py: Add identity tests for LOCALTIMESTAMP() and LOCALTIMESTAMP(3)
  • annotate_functions.sql: Add type annotation tests

@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

SQLGlot Integration Test Results

Comparing:

  • this branch (sqlglot:feature/annotatetype-localtimestamp, sqlglot version: feature/annotatetype-localtimestamp)
  • baseline (main, sqlglot version: 28.5.1.dev59)

⚠️ Limited to dialects: snowflake

By Dialect

dialect main sqlglot:feature/annotatetype-localtimestamp difference links
snowflake -> duckdb 626/1085 passed (57.7%) 626/1085 passed (57.7%) No change full result / delta
snowflake -> snowflake 981/1085 passed (90.4%) 981/1085 passed (90.4%) No change full result / delta

Overall

main: 2170 total, 1607 passed (pass rate: 74.1%), sqlglot version: 28.5.1.dev59

sqlglot:feature/annotatetype-localtimestamp: 2170 total, 1607 passed (pass rate: 74.1%), sqlglot version: feature/annotatetype-localtimestamp

Difference: No change

Copy link
Collaborator

@VaggelisD VaggelisD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, only one nit from me:

@fivetran-kwoodbeck fivetran-kwoodbeck force-pushed the feature/annotatetype-localtimestamp branch from 416122e to 3905b90 Compare January 5, 2026 16:11
@VaggelisD VaggelisD merged commit a669651 into main Jan 7, 2026
9 checks passed
@VaggelisD VaggelisD deleted the feature/annotatetype-localtimestamp branch January 7, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants