snowflakedb / snowpark-python

Snowflake Snowpark Python API
Apache License 2.0
255 stars 106 forks source link

SNOW-1507519: Support column_order="name" based inserts #1844

Closed sfc-gh-pkommini closed 1 month ago

sfc-gh-pkommini commented 2 months ago

What is the current behavior?

While execute this code:

my_temp_table.write.mode("append").save_as_table(
            [self.database, self.schema, self.table],
            column_order='name',
        )

We get this error:

NotImplementedError: [Local Testing] Inserting data into table by matching columns is not supported.

What is the desired behavior?

I want the insert to happen.

How would this improve snowflake-snowpark-python?

This would allow us to insert without specifying column list.

References, Other Background

We need this for an internal project.

sfc-gh-sghosh commented 2 months ago

Hello @sfc-gh-pkommini ,

Thanks for raising the issue. This is working fine without local_testing. The issue is only with local_testing. We will work on eliminating it.

Regards, Sujan

mraraujo commented 2 months ago

This would also be meaningful for us, especially related to inserts on tables with autoincrement columns.

sfc-gh-pkommini commented 2 months ago

@sfc-gh-sghosh Started a PR for this feature #1854

sfc-gh-aling commented 1 month ago

PR merged: https://github.com/snowflakedb/snowpark-python/pull/1872, it will be included in our next release

sfc-gh-aling commented 1 month ago

closing the issue as the feature is released in v1.20.0