SnowPro Associate: Platform Question 79
Single answer○ PythonA data engineering team is building a Python application that must load sales data into Snowflake every 15 minutes and then run a SQL transformation. The application will run outside Snowflake on a company-managed server. The team wants the simplest supported approach to connect from Python, execute SQL statements, and fetch status information about the load. Which option best meets this requirement?
- A
Use the Snowflake Connector for Python to connect to Snowflake, execute the COPY INTO and transformation SQL statements, and retrieve execution results from Python.
- B
Use Snowpark Python because it is the only supported way for Python applications outside Snowflake to execute SQL statements in Snowflake.
- C
Use Python UDFs as the primary client integration method, because they are designed for external applications to open connections and manage load jobs.
- D
Use a JDBC driver from Python, because Snowflake does not provide a native Python connectivity option for executing SQL.
Show answer and explanation
Correct answer: A
Explanation
For an external Python application that needs to connect to Snowflake, execute SQL, and retrieve results, the Snowflake Connector for Python is the best fit. It is a supported client library intended for Python-based connectivity and common application tasks such as authentication, issuing DDL/DML, running COPY INTO commands, and fetching query results. Snowpark for Python is also a valid Snowflake technology, but it is aimed more at building data transformation logic with the Snowpark API rather than serving as the simplest general-purpose connectivity layer for a scheduled Python client. Python UDFs are executed inside Snowflake and are not used to initiate external connections. This aligns with Snowflake documentation on client connectivity and the Snowflake Connector for Python as the primary Python interface for applications outside Snowflake.
- A. Correct.
Correct. The Snowflake Connector for Python is the standard supported client library for Python applications running outside Snowflake. It allows applications to authenticate, open sessions, execute SQL statements such as COPY INTO and transformation queries, and fetch results or execution status. This is the most direct and practical choice for a scheduled external Python process.
- B. Incorrect.
Incorrect. Snowpark for Python is a developer framework for working with data processing logic in Snowflake using Python APIs, but it is not the only supported way for external Python applications to execute SQL. The Snowflake Connector for Python is specifically designed for Python connectivity and is the simpler fit for a client application whose main task is to run SQL statements on a schedule.
- C. Incorrect.
Incorrect. Python UDFs run inside Snowflake to process data within SQL queries. They are not a client connectivity mechanism for an external Python application to open connections, orchestrate jobs, or manage recurring load processes from a company-managed server. This option confuses in-database execution with external application connectivity.
- D. Incorrect.
Incorrect. Snowflake does support a native Python connectivity option: the Snowflake Connector for Python. While JDBC is a valid connectivity technology for Java-based applications and can sometimes be used indirectly from Python through additional libraries, it is not the simplest or most appropriate supported choice here.