-
Notifications
You must be signed in to change notification settings - Fork 112
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-1437407: [Local Testing] convert_timezone calls mock_convert_timezone with wrong argument order #1630
Comments
Also relevant: mock_convert_timezone calls dateutil.tz.gettz(source_timezone), which is not possible if source_timezone is wrapped in a Note that #1299 did not add tests with source timezones. |
Hello @mraraujo , Thanks for raising the issue, we are looking into it and will update you. Regards, |
I am also encountering this issue on older Python and newer Snowpark 1. What version of Python are you using? 2. What operating system and processor architecture are you using? 3. What are the component versions in the environment (pip freeze)? 4. What did you do? 5. What did you expect to see? Code
Parameters inside convert_timezone Mock. source_time{ColumnEmulator: (1,)}=0 EST dtype: object Stack Trace (path shortened to /Code): Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): Forcing parameters while debugging:
target_timezone{ColumnEmulator: (1,)}=0 EST dtype: object Stack Trace (path shortened to /Code): ValueError: [Local Testing] convert_timezone can only convert NTZ timestamps when source_timezone is specified. The above exception was the direct cause of the following exception: Traceback (most recent call last): |
@sfc-gh-sghosh Any updates on this bugfix? |
Hi @mraraujo , The team is working on it. Regards, |
A fix for this was released in v1.19.0 |
3.11.6
Linux-6.5.0-28-generic-x86_64-with-glibc2.38
pip freeze
)?Snowpark version 1.16.0
Called
convert_timezone(lit('UTC'), col("timestamp"), lit('Asia/Singapore'))
What did you expect to see?
I expected the timezone to be converted to UTC. Instead, one gets
Looking into the code, one can see that both convert_timezone (from functions.py) and mock_convert_timezone (from _functions.py) have their parameters in the same order (target_timezone, source_time, source_timezone).
However, convert_timezone calls
flipping them to match the order of the SQL convert_timezone. However, this breaks mock_convert_timezone.
The text was updated successfully, but these errors were encountered: