Skip to content

SNOW-2119489: Add support for interval types in json format #2336

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sfc-gh-nkumar
Copy link
Contributor

Please answer these questions before submitting your pull requests. Thanks!

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

    Fixes SNOW-2119489

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am modifying authorization mechanisms
    • I am adding new credentials
    • I am modifying OCSP code
    • I am adding a new dependency
  3. Please describe how your code solves the related issue.

This PR adds support for INTERVAL YEAR MONTH and INTERVAL DAY TIME to the python connector in JSON format.

Implementation details:

For year-month interval we receive number of months as integer (represented as string) from server. Python timedelta only supports days, seconds and microseconds so this is mapped to ANSI formatted interval string. In numpy it is mapped to numpy.timedelta64.
For day-time interval we receive number of nanoseconds as integer (represented as string). We convert this to timedelta and numpy.timedelta64.

  1. (Optional) PR for stored-proc connector:

@sfc-gh-nkumar sfc-gh-nkumar force-pushed the nkumar-SNOW-2119489-json branch 2 times, most recently from a671266 to 967637a Compare May 24, 2025 01:49
@sfc-gh-nkumar sfc-gh-nkumar force-pushed the nkumar-SNOW-2119489-json branch from 967637a to 145d325 Compare May 27, 2025 17:53
@sfc-gh-nkumar sfc-gh-nkumar requested a review from a team May 27, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants