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-1707419: Improve error message for unknown timezone in tz_convert and tz_localize #2429

Merged
merged 5 commits into from
Oct 15, 2024

Conversation

sfc-gh-helmeleegy
Copy link
Contributor

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

    Fixes SNOW-1707419

  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.

    Improve error message for unknown timezone in tz_convert and tz_localize.

Copy link
Contributor

@sfc-gh-lmukhopadhyay sfc-gh-lmukhopadhyay left a comment

Choose a reason for hiding this comment

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

LGTM! I just had one suggestion for checking the error message in the negative tests

tests/integ/modin/frame/test_tz_convert.py Show resolved Hide resolved
Copy link
Collaborator

@sfc-gh-azhan sfc-gh-azhan left a comment

Choose a reason for hiding this comment

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

why not just support it?

Copy link
Contributor

@sfc-gh-jjiao sfc-gh-jjiao left a comment

Choose a reason for hiding this comment

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

I am not sure why we are checking the input string against pytz.all_timezones.

By comparison, native pandas does support timezone format like UTC:+09:00 etc

Screenshot 2024-10-11 at 11 52 56 AM

@sfc-gh-helmeleegy sfc-gh-helmeleegy enabled auto-merge (squash) October 11, 2024 20:18
@sfc-gh-helmeleegy
Copy link
Contributor Author

I am not sure why we are checking the input string against pytz.all_timezones.

By comparison, native pandas does support timezone format like UTC:+09:00 etc

Screenshot 2024-10-11 at 11 52 56 AM

It's mainly to stay consistent with Snowflake's restrictions on input timezones. Please refer to the previous thread.

@sfc-gh-jjiao
Copy link
Contributor

I am not sure why we are checking the input string against pytz.all_timezones.
By comparison, native pandas does support timezone format like UTC:+09:00 etc
Screenshot 2024-10-11 at 11 52 56 AM

It's mainly to stay consistent with Snowflake's restrictions on input timezones. Please refer to the previous thread.

Sounds good!

This PR is only dealing with error message?

            ErrorMessage.not_implemented(
                f"Snowpark pandas 'tz_convert' method doesn't support 'tz={tz}'"
            )

Could we update this PR directly to raise NotImplementedError or you are going to merge this first and then create a new PR to do that?

@sfc-gh-helmeleegy
Copy link
Contributor Author

Sounds good!

This PR is only dealing with error message?

            ErrorMessage.not_implemented(
                f"Snowpark pandas 'tz_convert' method doesn't support 'tz={tz}'"
            )

Could we update this PR directly to raise NotImplementedError or you are going to merge this first and then create a new PR to do that?

This PR already raises NotImplementedError.

@sfc-gh-helmeleegy
Copy link
Contributor Author

why not just support it?

Addressed in other threads.

@sfc-gh-helmeleegy sfc-gh-helmeleegy added the NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs label Oct 15, 2024
@sfc-gh-helmeleegy sfc-gh-helmeleegy merged commit 74769aa into main Oct 15, 2024
37 of 38 checks passed
@sfc-gh-helmeleegy sfc-gh-helmeleegy deleted the helmeleegy-SNOW-1707419 branch October 15, 2024 01:01
@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs snowpark-pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants