snowflakedb / snowflakedb/snowpark-python

SNOW-2327397: Schema is not inferred during write operations

Open
#3,757 3 comments 1 reaction 1 assignee View on GitHub

@sfc-gh-aling is already working on this.

Since Sep 15, 2025.

bug needs triage
Dominant language
Python
Stars
341
Forks
155
Avg merge
4d 16h
Merged PRs (30d)
27

Description

  1. What version of Python are you using?

    3.12

  2. What operating system and processor architecture are you using?

    Docker image python:3.12-slim

  3. What are the component versions in the environment (pip freeze)?

    snowflake-snowpark-python==1.38.0

  4. What did you do?

    When performing write operations, such as uploading a dataframe to a table or performing a merge over an existing table, schema is not inferred from the given table name even if the table name has a (semi-)fully qualified name (for example schema.table or db.schema.table).

    The resulting error, however states that using the (semi-)fully qualified name is indeed an option. For example, this is the error message shown when performing a merge with fully qualified table names:

    ClientError: AlgorithmError: SnowparkSQLException("090106 (22000): 01beeed7-0305-2a87-0001-8d0a1f96a5d6: Cannot perform DROP. This session does not have a current schema. Call 'USE SCHEMA', or use a qualified name.", '1304', '01beeed7-0305-2a87-0001-8d0a1f96a5d6'), exit code: 1
    

    By explicitly setting the schema with sql (session.sql("USE SCHEMA ...").collect()), the same merge operation succeeds.

  5. What did you expect to see?

    Infer and automatically set the right schema when table name is formatted as schema.table or db.schema.table, as the above error suggests

  6. Can you set logging to DEBUG and collect the logs?

    I'll add this if needed, doesn't seem useful to me

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.