-
Notifications
You must be signed in to change notification settings - Fork 116
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-1520022: Issues with VariantType Column Casting and Data Collection in Snowpark-Python #1881
Comments
Hello @hima-gopisetty , Thanks for raising the issue, we are looking into it, will update. Regards, |
@hima-gopisetty, Similar to my last comment. I believe you are running commands directly in the terminal, that's when I got the same error as yours but please correct me if I am wrong. Executing the same inside the Python environment works fine for me. PS: I am using a very similar configuration to your environment setup |
Hello @hima-gopisetty , I checked the code snippet and ran it with latest Snowflake python snowpark version 1.19.0 and there is no error, its working as expected with both local and session object. Its getting casting to IntegerType and the output is 59 and not 59.0 Please run it with the latest Snowpark Python 1.19.0 and let us know. Here is the output: `StructType([StructField('WH_PREFIX', StringType(16777216), nullable=True), StructField('CONFIG_METADATA', VariantType(), nullable=True)])|"WH_PREFIX" |"CONFIG_METADATA" ||WHS |{ |
|
Hello @hima-gopisetty , Closing the issue as it's working fine with the latest snowflake connector, so please use latest snowflake python connector. Regards, |
Please answer these questions before submitting your issue. Thanks!
What version of Python are you using?
What are the Snowpark Python and pandas versions in the environment?
What did you do?
I attempted to create a DataFrame containing configuration metadata using Snowpark-Python. The metadata includes a field
autoSuspendDuration
with a numeric value.Encountered two issues:
autoSuspendDuration
field toIntegerType
, the resulting value wasDecimal('59.0')
instead of the expected59
.autoSuspendDuration
field resulted in aTypeError: Object of type int64 is not JSON serializable
.Here's the complete runnable program:
What did you expect to see?
autoSuspendDuration
column to be of typeIntegerType
and have a value of59
, but it is giving a value ofDecimal('59.0')
.autoSuspendDuration
column but throws aTypeError: Object of type int64 is not JSON serializable
.Error Traceback:
Issue Descriptions:
autoSuspendDuration
value from aVariantType
toIntegerType
, the resulting value isDecimal('59.0')
instead of59
.autoSuspendDuration
column of typeVariantType
throws aTypeError: Object of type int64 is not JSON serializable
.The text was updated successfully, but these errors were encountered: