Questions tagged [snowpark]

For questions regarding programming in Snowpark Python or Scala APIs

41 questions
0
votes
2 answers

Keeping the schema types from Pandas dataframe to Snowpark dataframe

Snowpark has a problem / bug that it does not maintain the types between Pandas and Snowpark, nor does it allow to manually set its schema. For instance, df1 = session.sql(sql).to_pandas() df2 = session.create_dataframe(df) The timestamp field on…
0
votes
1 answer

How to resample data using the Snowpark API for Python

I am trying to resample some quarterly data in Snowflake into daily data using Snowpark, I have some code that accomplishes this in PySpark; however, it seems that the function "explode()" does not have support in Snowpark. # define function to…
Finn Formica
  • 86
  • 1
  • 7
0
votes
1 answer

Join Dataframes from different DBs using Snowpark

I am trying to join two tables/dataframes that come from different databases of snowflake, I am trying to do this using snowpark, not sql way(i.e., session.sql("")). # Connecting to Database one first_session =…
0
votes
0 answers

SQL compilation error: Package 'inspect' is not supported

I have to create procedure in snowpark with python. I'm trying to get the procedure name inside the function. CREATE OR REPLACE PROCEDURE TST() RETURNS STRING LANGUAGE PYTHON RUNTIME_VERSION = '3.8' PACKAGES =…
0
votes
1 answer

Snowpark with Python: AttributeError: 'NoneType' object has no attribute 'join'

I'm trying to use Snowpark & Python to transform and prep some data ahead of using it for some ML models. I've been able to easily use session.table() to access the data and select(), col(), filter(), and alias() to pick out the data I need. I'm now…
0
votes
2 answers

Snowpark with GEOMETRY type fails

I try to parse WKT and create GEOMETRY type with Snowpark Python API, but it fails: session.sql("select to_geometry('POINT(1820.12 890.56)')").show() TypeError: '>' not supported between instances of 'NoneType' and 'int' I tested both Version…
Raphael Roth
  • 26,751
  • 15
  • 88
  • 145
0
votes
1 answer

Snowpark SQL compilation error: unexpected '-' in Role name

When trying to connect to Snowpark using the session method below with role, database, schema, and warehouse names, there is a SQL compilation error with the role name since it contains dashes. dbname = "MY_DB" schemaname = "MY_SCHEMA" warehouse =…
0
votes
2 answers

How to run Snowpark created UDF from inside Snowflake Web console worksheet?

When I run select myadd(2,2); in the Worksheet tab of the Snowflake Web console, I get an error "SQL compilation error: Unknown function MYADD" but the UDF works in Snowpark. Why cannot I execute the Snowpark created UDF in Snowflake worksheet? It…
psabela
  • 324
  • 1
  • 3
  • 16
0
votes
1 answer

Adding Library snowflake-snowpark-python to Azure Function

Hi All I am new to Azure Function , this is my case ,i have Snowflake Snowpark library which is python 3.8 compatible and my Azure function python version is 3.9.7. When i am trying to run this code using visual studio (Virtual env selected as…
0
votes
1 answer

Creating Snowpark Session using account with SSO

I'm working on a Snowpark project using the Python API. My Snowflake account requires SSO, so I've used the SSO method to get connected, but I'm having issues with there being no defined session. How do I fix this so that I can start working with…
0
votes
1 answer

What does SnowPark pushdown feature mean? Can i run my code on separate cluster with out moving it to Snowlfake?

I am trying to understand what exactly Snowpark pushdown feature do? from the documentation it already looks like the code is getting executed directly on Snowflake rather than the external clusters. Also, is it possible for me to run the code on my…
1 2
3