alicia_h87
alicia_h87

Reputation: 11

I cannot create a snowflake table from a snowpark dataframe with dataframe.write.mode()

I am trying to create a new snowpark temporary table from a snowpark dataframe, using a python worksheet.

I have been trying a lot of things, and finally, I literally copied the code in the snowflake documentation, and I am getting the same error message, this is the code as it is in snowflake documentation site:

    df = session.create_dataframe([[1, 2], [3, 4]], schema=["a", "b"])
    df.write.mode("overwrite").save_as_table(table_name= "saved_table", table_type="temporary")
    session.table("saved_table").show()

error message is:

No overloads for .save_as_table match the provided arguments

Argument types:(Literal['saved_table'], Literal['temporary'])

Snowflake documentation: https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/latest/api/snowflake.snowpark.DataFrame.write

Any ideas what I could be doing wrong?

I am expecting to create a temp table in Snowflake from a Snowpark Dataframe which is created by a Snowflake stored proc

Upvotes: 1

Views: 1530

Answers (1)

alicia_h87
alicia_h87

Reputation: 11

After working on it for a while, I figured out that although there is an error message, the code works...it is misleading...but I am happy now.

Upvotes: 0

Related Questions