You have already completed the Test before. Hence you can not start it again.
Test is loading...
You must sign in or sign up to start the Test.
You have to finish following quiz, to start this Test:
Your results are here!! for" Snowflake SnowPro Specialty Snowpark Practice Test 2 "
0 of 40 questions answered correctly
Your time:
Time has elapsed
Your Final Score is : 0
You have attempted : 0
Number of Correct Questions : 0 and scored 0
Number of Incorrect Questions : 0 and Negative marks 0
Average score
Your score
Snowflake SnowPro Specialty Snowpark
You have attempted: 0
Number of Correct Questions: 0 and scored 0
Number of Incorrect Questions: 0 and Negative marks 0
You can review your answers by clicking on “View Answers” option. Important Note : Open Reference Documentation Links in New Tab (Right Click and Open in New Tab).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Answered
Review
Question 1 of 40
1. Question
What are some guidelines to perform single-node ML training workloads? (choose two)
Correct
Follow these guidelines to perform single-node ML training workloads: · Set WAREHOUSE_SIZE = MEDIUM to ensure that the Snowpark-optimized warehouse consists of 1 Snowpark-optimized node. (There is no SMALL size for Snowpark-optimized warehouses!) · Consider setting up the warehouse as multi-cluster warehouse to support the desired concurrency if needed. · Consider using a separate warehouse for executing nested queries from the stored procedure: Use the session.use_warehouse() API to select the warehouse for the query inside the stored procedure. · Dont mix other workloads on the Snowpark-optimized warehouse that is used to run ML training stored procedures. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/python-snowpark-training-ml#guidelines
Incorrect
Follow these guidelines to perform single-node ML training workloads: · Set WAREHOUSE_SIZE = MEDIUM to ensure that the Snowpark-optimized warehouse consists of 1 Snowpark-optimized node. (There is no SMALL size for Snowpark-optimized warehouses!) · Consider setting up the warehouse as multi-cluster warehouse to support the desired concurrency if needed. · Consider using a separate warehouse for executing nested queries from the stored procedure: Use the session.use_warehouse() API to select the warehouse for the query inside the stored procedure. · Dont mix other workloads on the Snowpark-optimized warehouse that is used to run ML training stored procedures. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/python-snowpark-training-ml#guidelines
Unattempted
Follow these guidelines to perform single-node ML training workloads: · Set WAREHOUSE_SIZE = MEDIUM to ensure that the Snowpark-optimized warehouse consists of 1 Snowpark-optimized node. (There is no SMALL size for Snowpark-optimized warehouses!) · Consider setting up the warehouse as multi-cluster warehouse to support the desired concurrency if needed. · Consider using a separate warehouse for executing nested queries from the stored procedure: Use the session.use_warehouse() API to select the warehouse for the query inside the stored procedure. · Dont mix other workloads on the Snowpark-optimized warehouse that is used to run ML training stored procedures. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/python-snowpark-training-ml#guidelines
Question 2 of 40
2. Question
Which of the following is a valid rule when you call dropna on a DataFrame with a thresh parameter? (choose one)
Correct
thresh overwrites how and specifies the minimum number of non-null and non-NaN values that should be in the specified columns in order for the row to be included: · If thresh is not provided or None, the length of subset will be used when how is any and 1 will be used when how is all. · If thresh is greater than the number of the specified columns, the method returns an empty DataFrame. · If thresh is less than 1, the method returns the original DataFrame. dropna is a rather tricky method, learn well what it does and what are the possible values for its parameters. References: https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/latest/snowpark/api/snowflake.snowpark.DataFrame.dropna
Incorrect
thresh overwrites how and specifies the minimum number of non-null and non-NaN values that should be in the specified columns in order for the row to be included: · If thresh is not provided or None, the length of subset will be used when how is any and 1 will be used when how is all. · If thresh is greater than the number of the specified columns, the method returns an empty DataFrame. · If thresh is less than 1, the method returns the original DataFrame. dropna is a rather tricky method, learn well what it does and what are the possible values for its parameters. References: https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/latest/snowpark/api/snowflake.snowpark.DataFrame.dropna
Unattempted
thresh overwrites how and specifies the minimum number of non-null and non-NaN values that should be in the specified columns in order for the row to be included: · If thresh is not provided or None, the length of subset will be used when how is any and 1 will be used when how is all. · If thresh is greater than the number of the specified columns, the method returns an empty DataFrame. · If thresh is less than 1, the method returns the original DataFrame. dropna is a rather tricky method, learn well what it does and what are the possible values for its parameters. References: https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/latest/snowpark/api/snowflake.snowpark.DataFrame.dropna
Question 3 of 40
3. Question
Which of the following loads a GZIP compressed JSON file? (choose one)
How are NULLs handled by pandas on Snowflake? (choose one)
Correct
Pandas on Snowflake adopts a similar approach to earlier pandas versions that treat all of the preceding values listed as missing values. Snowpark reuses NaN, NA, and NaT from pandas. But note that all these missing values are treated interchangeably and stored as SQL NULL in the Snowflake table. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/pandas-on-snowflake
Incorrect
Pandas on Snowflake adopts a similar approach to earlier pandas versions that treat all of the preceding values listed as missing values. Snowpark reuses NaN, NA, and NaT from pandas. But note that all these missing values are treated interchangeably and stored as SQL NULL in the Snowflake table. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/pandas-on-snowflake
Unattempted
Pandas on Snowflake adopts a similar approach to earlier pandas versions that treat all of the preceding values listed as missing values. Snowpark reuses NaN, NA, and NaT from pandas. But note that all these missing values are treated interchangeably and stored as SQL NULL in the Snowflake table. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/pandas-on-snowflake
Question 6 of 40
6. Question
How can you perform a self-join on a Snowpark DataFrame? (choose one)
Correct
If you want to perform a self-join, you must copy the DataFrame: from copy import copy df_lhs = session.create_dataframe([[“a“, 1], [“b“, 2]], schema=[“key“, “value1“]) df_rhs = session.create_dataframe([[“a“, 3], [“b“, 4]], schema=[“key“, “value2“]) df_lhs_copied = copy(df_lhs) df_self_joined = df_lhs.join(df_lhs_copied, (df_lhs.col(“key“) == df_lhs_copied.col(“key“)) References: https://docs.snowflake.com/en/developer-guide/snowpark/python/working-with-dataframes
Incorrect
If you want to perform a self-join, you must copy the DataFrame: from copy import copy df_lhs = session.create_dataframe([[“a“, 1], [“b“, 2]], schema=[“key“, “value1“]) df_rhs = session.create_dataframe([[“a“, 3], [“b“, 4]], schema=[“key“, “value2“]) df_lhs_copied = copy(df_lhs) df_self_joined = df_lhs.join(df_lhs_copied, (df_lhs.col(“key“) == df_lhs_copied.col(“key“)) References: https://docs.snowflake.com/en/developer-guide/snowpark/python/working-with-dataframes
Unattempted
If you want to perform a self-join, you must copy the DataFrame: from copy import copy df_lhs = session.create_dataframe([[“a“, 1], [“b“, 2]], schema=[“key“, “value1“]) df_rhs = session.create_dataframe([[“a“, 3], [“b“, 4]], schema=[“key“, “value2“]) df_lhs_copied = copy(df_lhs) df_self_joined = df_lhs.join(df_lhs_copied, (df_lhs.col(“key“) == df_lhs_copied.col(“key“)) References: https://docs.snowflake.com/en/developer-guide/snowpark/python/working-with-dataframes
Question 7 of 40
7. Question
How can you add a file that your code depends on to a Python worksheet? (choose one)
Correct
Because Python worksheets run inside Snowflake rather than in your local development environment, you cannot use session.add_import to add a file that your Python code depends on, or session.add_packages or session.add_requirements to add packages that you need to use in your Python code. Instead, you add those files to a stage and reference them in your code. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/python-worksheets
Incorrect
Because Python worksheets run inside Snowflake rather than in your local development environment, you cannot use session.add_import to add a file that your Python code depends on, or session.add_packages or session.add_requirements to add packages that you need to use in your Python code. Instead, you add those files to a stage and reference them in your code. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/python-worksheets
Unattempted
Because Python worksheets run inside Snowflake rather than in your local development environment, you cannot use session.add_import to add a file that your Python code depends on, or session.add_packages or session.add_requirements to add packages that you need to use in your Python code. Instead, you add those files to a stage and reference them in your code. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/python-worksheets
Question 8 of 40
8. Question
How can you create and call a UDF for your custom code? (choose two)
Correct
You can create a UDF for your custom code in one of two ways: · You can create an anonymous UDF and assign the function to a variable. As long as this variable is in scope, you can use this variable to call the UDF. · You can create a named UDF and call the UDF by name. You can use this if, for example, you need to call a UDF by name or use the UDF in a subsequent session. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/creating-udfs
Incorrect
You can create a UDF for your custom code in one of two ways: · You can create an anonymous UDF and assign the function to a variable. As long as this variable is in scope, you can use this variable to call the UDF. · You can create a named UDF and call the UDF by name. You can use this if, for example, you need to call a UDF by name or use the UDF in a subsequent session. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/creating-udfs
Unattempted
You can create a UDF for your custom code in one of two ways: · You can create an anonymous UDF and assign the function to a variable. As long as this variable is in scope, you can use this variable to call the UDF. · You can create a named UDF and call the UDF by name. You can use this if, for example, you need to call a UDF by name or use the UDF in a subsequent session. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/creating-udfs
Question 9 of 40
9. Question
Which of the following will pass in a proper way input types to a Snowpark UDTF? (choose one)
What minimal import may be required for that code? (Choose one)
Correct
Both upper() and col() are global functions defined in the snowflake.snowpark.functions namespace.
The code directly calls upper(…) and col(…), so both must be imported explicitly
Option A would require using F.upper and F.col, which the code does not do
Option D works, but it is not minimal, as it imports many unnecessary symbols
Therefore, the minimal and correct import is:
from snowflake.snowpark.functions import upper, col
Incorrect
Both upper() and col() are global functions defined in the snowflake.snowpark.functions namespace.
The code directly calls upper(…) and col(…), so both must be imported explicitly
Option A would require using F.upper and F.col, which the code does not do
Option D works, but it is not minimal, as it imports many unnecessary symbols
Therefore, the minimal and correct import is:
from snowflake.snowpark.functions import upper, col
Unattempted
Both upper() and col() are global functions defined in the snowflake.snowpark.functions namespace.
The code directly calls upper(…) and col(…), so both must be imported explicitly
Option A would require using F.upper and F.col, which the code does not do
Option D works, but it is not minimal, as it imports many unnecessary symbols
Therefore, the minimal and correct import is:
from snowflake.snowpark.functions import upper, col
Question 11 of 40
11. Question
Which statement will generate a result like below, with the total monthly sales per employee? (choose one) —————————- |“EMPID“ |“‘FEB‘“ |“‘JAN‘“ | —————————- |1 |8000 |10400 | |2 |200 |39500 |
From a DataFrame, you need the aggregate count and sum of values from a column a. (choose one)
Correct
You can pass a variable length arguments list where every element is: · A Column object. · A tuple where the first element is a column object or a column name and the second element is the name of the aggregate function. Choice B is correct here, choice D is not (it looks more like a dictionary inside). · A dictionary that maps column names to aggregate function names. Remark that first choice looks legit as well, but the dictionary keys are not unique, as they refer to the same column. This particular use case cannot use this syntax! References: https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/1.3.0/api/snowflake.snowpark.DataFrame.agg
Incorrect
You can pass a variable length arguments list where every element is: · A Column object. · A tuple where the first element is a column object or a column name and the second element is the name of the aggregate function. Choice B is correct here, choice D is not (it looks more like a dictionary inside). · A dictionary that maps column names to aggregate function names. Remark that first choice looks legit as well, but the dictionary keys are not unique, as they refer to the same column. This particular use case cannot use this syntax! References: https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/1.3.0/api/snowflake.snowpark.DataFrame.agg
Unattempted
You can pass a variable length arguments list where every element is: · A Column object. · A tuple where the first element is a column object or a column name and the second element is the name of the aggregate function. Choice B is correct here, choice D is not (it looks more like a dictionary inside). · A dictionary that maps column names to aggregate function names. Remark that first choice looks legit as well, but the dictionary keys are not unique, as they refer to the same column. This particular use case cannot use this syntax! References: https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/1.3.0/api/snowflake.snowpark.DataFrame.agg
Question 14 of 40
14. Question
Whats a particular benefit of calling DataFrame.cache_result()? (choose one)
Which DataFrame call will provide you a result similar to this one: (choose one) —————————————————- |“SUMMARY“ |“A“ |“B“ | —————————————————- |count |2.0 |2.0 | |max |3.0 |4.0 | |mean |2.0 |3.0 | |min |1.0 |2.0 | |stddev |1.4142135623730951 |1.4142135623730951 |
What is required to use and install the local testing framework for Snowpark Python? (choose two)
Correct
To install the library with the optional dependency, run the following command: pip install “snowflake-snowpark-python[localtest]“. Then you create a session and enable local testing, by setting the local_testing configuration to True: session = Session.builder.config(‘local_testing‘, True).create() References: https://docs.snowflake.com/en/developer-guide/snowpark/python/testing-locally
Incorrect
To install the library with the optional dependency, run the following command: pip install “snowflake-snowpark-python[localtest]“. Then you create a session and enable local testing, by setting the local_testing configuration to True: session = Session.builder.config(‘local_testing‘, True).create() References: https://docs.snowflake.com/en/developer-guide/snowpark/python/testing-locally
Unattempted
To install the library with the optional dependency, run the following command: pip install “snowflake-snowpark-python[localtest]“. Then you create a session and enable local testing, by setting the local_testing configuration to True: session = Session.builder.config(‘local_testing‘, True).create() References: https://docs.snowflake.com/en/developer-guide/snowpark/python/testing-locally
Question 24 of 40
24. Question
Which is the proper way to change the definition of a Task, assuming all the import statements to snowflake.core and the related libraries have been executed properly? (Choose one)
Correct
In the snowflake.core Python API, tasks are managed using a resource-based model.
Key concepts:
Root(session)…tasks[‘…‘] returns a Task resource reference, not the actual task object
To modify a task, you must:
Fetch the task object using .fetch()
Modify the task properties (for example, definition)
Persist the change using create_or_alter() on the resource, passing the updated task
Why Option B is correct:
res represents the Task resource
task = res.fetch() retrieves the current task definition
task.definition = “…“ modifies the task
res.create_or_alter(task) applies the change in Snowflake
Why the others are incorrect:
A: Attempts to call create_or_alter() directly on a resource reference without fetching
C: session.create_or_alter() is not used for task updates
D: Calls create_or_alter() on a fetched object instead of the resource
This fetchmodifyapply pattern is fundamental when managing tasks with the Snowflake Python (snowflake.core) API.
Incorrect
In the snowflake.core Python API, tasks are managed using a resource-based model.
Key concepts:
Root(session)…tasks[‘…‘] returns a Task resource reference, not the actual task object
To modify a task, you must:
Fetch the task object using .fetch()
Modify the task properties (for example, definition)
Persist the change using create_or_alter() on the resource, passing the updated task
Why Option B is correct:
res represents the Task resource
task = res.fetch() retrieves the current task definition
task.definition = “…“ modifies the task
res.create_or_alter(task) applies the change in Snowflake
Why the others are incorrect:
A: Attempts to call create_or_alter() directly on a resource reference without fetching
C: session.create_or_alter() is not used for task updates
D: Calls create_or_alter() on a fetched object instead of the resource
This fetchmodifyapply pattern is fundamental when managing tasks with the Snowflake Python (snowflake.core) API.
Unattempted
In the snowflake.core Python API, tasks are managed using a resource-based model.
Key concepts:
Root(session)…tasks[‘…‘] returns a Task resource reference, not the actual task object
To modify a task, you must:
Fetch the task object using .fetch()
Modify the task properties (for example, definition)
Persist the change using create_or_alter() on the resource, passing the updated task
Why Option B is correct:
res represents the Task resource
task = res.fetch() retrieves the current task definition
task.definition = “…“ modifies the task
res.create_or_alter(task) applies the change in Snowflake
Why the others are incorrect:
A: Attempts to call create_or_alter() directly on a resource reference without fetching
C: session.create_or_alter() is not used for task updates
D: Calls create_or_alter() on a fetched object instead of the resource
This fetchmodifyapply pattern is fundamental when managing tasks with the Snowflake Python (snowflake.core) API.
Question 25 of 40
25. Question
You need to create a DAG (Directed Acyclic Graph) with one task running a SQL query and another task executing a stored procedure. (Choose one)
Correct
When using the snowflake.core DAG API, the correct pattern is:
Define the DAG first, including its name and optional schedule
Create tasks inside the DAG context
Tasks can be:
SQL-based tasks using DAGTask(“name“, “SQL“)
Stored-procedure-based tasks using StoredProcedureCall wrapped in a DAGTask
Why Option A is correct:
The DAG is created with a name and schedule
Tasks are defined inside the with DAG(…) as dag: context, which automatically attaches them to the DAG
One task runs a SQL statement
One task executes a Snowpark stored procedure with proper staging and package configuration
Why the others are incorrect:
B: DAG is missing a name and schedule
C: Tasks are created outside the DAG context and are not attached to it
D: The DAG API does not accept tasks as constructor arguments
This context-manager pattern is required when building task graphs using the Snowflake Python (snowflake.core) API.
Incorrect
When using the snowflake.core DAG API, the correct pattern is:
Define the DAG first, including its name and optional schedule
Create tasks inside the DAG context
Tasks can be:
SQL-based tasks using DAGTask(“name“, “SQL“)
Stored-procedure-based tasks using StoredProcedureCall wrapped in a DAGTask
Why Option A is correct:
The DAG is created with a name and schedule
Tasks are defined inside the with DAG(…) as dag: context, which automatically attaches them to the DAG
One task runs a SQL statement
One task executes a Snowpark stored procedure with proper staging and package configuration
Why the others are incorrect:
B: DAG is missing a name and schedule
C: Tasks are created outside the DAG context and are not attached to it
D: The DAG API does not accept tasks as constructor arguments
This context-manager pattern is required when building task graphs using the Snowflake Python (snowflake.core) API.
Unattempted
When using the snowflake.core DAG API, the correct pattern is:
Define the DAG first, including its name and optional schedule
Create tasks inside the DAG context
Tasks can be:
SQL-based tasks using DAGTask(“name“, “SQL“)
Stored-procedure-based tasks using StoredProcedureCall wrapped in a DAGTask
Why Option A is correct:
The DAG is created with a name and schedule
Tasks are defined inside the with DAG(…) as dag: context, which automatically attaches them to the DAG
One task runs a SQL statement
One task executes a Snowpark stored procedure with proper staging and package configuration
Why the others are incorrect:
B: DAG is missing a name and schedule
C: Tasks are created outside the DAG context and are not attached to it
D: The DAG API does not accept tasks as constructor arguments
This context-manager pattern is required when building task graphs using the Snowflake Python (snowflake.core) API.
Question 26 of 40
26. Question
Which are two ways you can connect to the Snowflake Python API? (choose two)
Correct
The Snowflake Python API is a relatively new API, that requires installing and referencing the snowflake.core namespace. Before you can perform actions with the Snowflake Python APIs, you must define a connection to Snowflake. With the connection, you can create a Root object for access to resources modeled by the API. To connect to Snowflake, you can use either a Snowpark session, or a connection from the Snowflake Connector for Python. References: https://docs.snowflake.com/en/developer-guide/snowflake-python-api/snowflake-python-connecting-snowflake
Incorrect
The Snowflake Python API is a relatively new API, that requires installing and referencing the snowflake.core namespace. Before you can perform actions with the Snowflake Python APIs, you must define a connection to Snowflake. With the connection, you can create a Root object for access to resources modeled by the API. To connect to Snowflake, you can use either a Snowpark session, or a connection from the Snowflake Connector for Python. References: https://docs.snowflake.com/en/developer-guide/snowflake-python-api/snowflake-python-connecting-snowflake
Unattempted
The Snowflake Python API is a relatively new API, that requires installing and referencing the snowflake.core namespace. Before you can perform actions with the Snowflake Python APIs, you must define a connection to Snowflake. With the connection, you can create a Root object for access to resources modeled by the API. To connect to Snowflake, you can use either a Snowpark session, or a connection from the Snowflake Connector for Python. References: https://docs.snowflake.com/en/developer-guide/snowflake-python-api/snowflake-python-connecting-snowflake
Question 27 of 40
27. Question
Which of the following must or could be part of a UDTF handler class? (choose two)
Which of the following is properly registering a UDTF in Snowpark? (choose one)
Correct
To properly register a UDTF (User-Defined Table Function) in Snowpark:
The process method must yield tuples, even for a single column
UDTFs must be registered using udtf, not udf
If type hints are not provided in the class definition, you must explicitly specify:
input_types
output_schema
Why Option C is correct:
yield (i, ) correctly yields a single-element tuple
udtf(…) is used instead of udf(…)
Both input_types and output_schema are explicitly defined
Why the others are incorrect:
A: yield (i) is not a tuple; it must be yield (i, )
B: Registers a scalar UDF (udf) instead of a table function
D: Omits required type definitions when no type hints are present
This distinction between UDFs and UDTFs is commonly tested in Snowpark certification questions.
Incorrect
To properly register a UDTF (User-Defined Table Function) in Snowpark:
The process method must yield tuples, even for a single column
UDTFs must be registered using udtf, not udf
If type hints are not provided in the class definition, you must explicitly specify:
input_types
output_schema
Why Option C is correct:
yield (i, ) correctly yields a single-element tuple
udtf(…) is used instead of udf(…)
Both input_types and output_schema are explicitly defined
Why the others are incorrect:
A: yield (i) is not a tuple; it must be yield (i, )
B: Registers a scalar UDF (udf) instead of a table function
D: Omits required type definitions when no type hints are present
This distinction between UDFs and UDTFs is commonly tested in Snowpark certification questions.
Unattempted
To properly register a UDTF (User-Defined Table Function) in Snowpark:
The process method must yield tuples, even for a single column
UDTFs must be registered using udtf, not udf
If type hints are not provided in the class definition, you must explicitly specify:
input_types
output_schema
Why Option C is correct:
yield (i, ) correctly yields a single-element tuple
udtf(…) is used instead of udf(…)
Both input_types and output_schema are explicitly defined
Why the others are incorrect:
A: yield (i) is not a tuple; it must be yield (i, )
B: Registers a scalar UDF (udf) instead of a table function
D: Omits required type definitions when no type hints are present
This distinction between UDFs and UDTFs is commonly tested in Snowpark certification questions.
Question 29 of 40
29. Question
Which of the following is true for the type hints in a udf function call? (choose one)
Correct
Type hints are explicit Python data types provided in the signature of the function used to register a UDF. They can be provided for some arguments, and the returned value. These types will be converted to SQL types supported by Snowflake. You can enforce these types by declaring Snowpark data types in the input_types and return_type arguments, when you call the udf function. Properly understanding these type hints is very important for this Snowpark exam, and there is this simple rule that applies. References: https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/latest/snowpark/types https://thinketl.com/udfs-in-snowflake-snowpark/
Incorrect
Type hints are explicit Python data types provided in the signature of the function used to register a UDF. They can be provided for some arguments, and the returned value. These types will be converted to SQL types supported by Snowflake. You can enforce these types by declaring Snowpark data types in the input_types and return_type arguments, when you call the udf function. Properly understanding these type hints is very important for this Snowpark exam, and there is this simple rule that applies. References: https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/latest/snowpark/types https://thinketl.com/udfs-in-snowflake-snowpark/
Unattempted
Type hints are explicit Python data types provided in the signature of the function used to register a UDF. They can be provided for some arguments, and the returned value. These types will be converted to SQL types supported by Snowflake. You can enforce these types by declaring Snowpark data types in the input_types and return_type arguments, when you call the udf function. Properly understanding these type hints is very important for this Snowpark exam, and there is this simple rule that applies. References: https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/latest/snowpark/types https://thinketl.com/udfs-in-snowflake-snowpark/
Question 30 of 40
30. Question
Assuming all required import statements have been properly provided and executed, something is still missing from the following definition of a stored procedure with Snowpark. (Choose two)
@sproc(name=“calc_size“, is_permanent=True, replace=False) def calc_size(session, file_path: str) -> int: with SnowflakeFile.open(file_path) as f: s = f.read() return len(s)
Correct
Two required elements are missing:
Snowpark library dependency A Snowpark stored procedure must always include the snowflake-snowpark-python library in the packages parameter, with or without a specific version.
Stage location for permanent procedures When is_permanent=True, a stage_location must be provided. This stage is used to upload the Python code and its dependencies. Temporary and external stages cannot be used. If is_permanent=False, this parameter is ignored.
Why the other options are incorrect:
B: The session parameter does not need an explicit Session type hint when using sproc
C: Input and return types are already defined via Python type hints
E: replace=False is valid; it simply prevents overwriting an existing stored procedure
These requirements are commonly tested when working with permanent Snowpark stored procedures.
Incorrect
Two required elements are missing:
Snowpark library dependency A Snowpark stored procedure must always include the snowflake-snowpark-python library in the packages parameter, with or without a specific version.
Stage location for permanent procedures When is_permanent=True, a stage_location must be provided. This stage is used to upload the Python code and its dependencies. Temporary and external stages cannot be used. If is_permanent=False, this parameter is ignored.
Why the other options are incorrect:
B: The session parameter does not need an explicit Session type hint when using sproc
C: Input and return types are already defined via Python type hints
E: replace=False is valid; it simply prevents overwriting an existing stored procedure
These requirements are commonly tested when working with permanent Snowpark stored procedures.
Unattempted
Two required elements are missing:
Snowpark library dependency A Snowpark stored procedure must always include the snowflake-snowpark-python library in the packages parameter, with or without a specific version.
Stage location for permanent procedures When is_permanent=True, a stage_location must be provided. This stage is used to upload the Python code and its dependencies. Temporary and external stages cannot be used. If is_permanent=False, this parameter is ignored.
Why the other options are incorrect:
B: The session parameter does not need an explicit Session type hint when using sproc
C: Input and return types are already defined via Python type hints
E: replace=False is valid; it simply prevents overwriting an existing stored procedure
These requirements are commonly tested when working with permanent Snowpark stored procedures.
Question 31 of 40
31. Question
What are some typical recommendations about machine learning pipelines with Snowpark ML? (choose three)
Correct
The general consensus and recommendation is to use a Snowpark-optimized warehouse for model training, and a multi-node standard warehouse for model predictions and serving. Model training would happen in a stored procedure (automatically created in Snowpark ML on fit), and model serving in a temporary vectorized Python UDF (automatically created in Snowpark ML on predict). Snowflake also provides a Model Registry and a Feature Store. Youll get just a bunch of questions about Snowpark ML, but you must know the basics. References: https://docs.snowflake.com/en/developer-guide/snowflake-ml/modeling https://docs.snowflake.com/en/developer-guide/snowflake-ml/model-registry/overview
Incorrect
The general consensus and recommendation is to use a Snowpark-optimized warehouse for model training, and a multi-node standard warehouse for model predictions and serving. Model training would happen in a stored procedure (automatically created in Snowpark ML on fit), and model serving in a temporary vectorized Python UDF (automatically created in Snowpark ML on predict). Snowflake also provides a Model Registry and a Feature Store. Youll get just a bunch of questions about Snowpark ML, but you must know the basics. References: https://docs.snowflake.com/en/developer-guide/snowflake-ml/modeling https://docs.snowflake.com/en/developer-guide/snowflake-ml/model-registry/overview
Unattempted
The general consensus and recommendation is to use a Snowpark-optimized warehouse for model training, and a multi-node standard warehouse for model predictions and serving. Model training would happen in a stored procedure (automatically created in Snowpark ML on fit), and model serving in a temporary vectorized Python UDF (automatically created in Snowpark ML on predict). Snowflake also provides a Model Registry and a Feature Store. Youll get just a bunch of questions about Snowpark ML, but you must know the basics. References: https://docs.snowflake.com/en/developer-guide/snowflake-ml/modeling https://docs.snowflake.com/en/developer-guide/snowflake-ml/model-registry/overview
Question 32 of 40
32. Question
Which of the following will display version information about a specific package? (choose one)
Which of the following apply when importing packages through a Snowflake stage? (choose one)
Correct
You can only upload pure Python packages or packages with native code through a Snowflake stage. If your uploaded package has dependency on x86 CPU architecture, then you must use Snowpark-optimized warehouses and use the RESOURCE_CONSTRAINT warehouse property, with CPU architecture x86. The stage hosting the file must be readable by the owner of the UDF. Also, ZIP files must be self-contained and not rely on any additional setup scripts to be executed. References: https://docs.snowflake.com/en/developer-guide/udf/python/udf-python-packages#importing-packages-through-a-snowflake-stage
Incorrect
You can only upload pure Python packages or packages with native code through a Snowflake stage. If your uploaded package has dependency on x86 CPU architecture, then you must use Snowpark-optimized warehouses and use the RESOURCE_CONSTRAINT warehouse property, with CPU architecture x86. The stage hosting the file must be readable by the owner of the UDF. Also, ZIP files must be self-contained and not rely on any additional setup scripts to be executed. References: https://docs.snowflake.com/en/developer-guide/udf/python/udf-python-packages#importing-packages-through-a-snowflake-stage
Unattempted
You can only upload pure Python packages or packages with native code through a Snowflake stage. If your uploaded package has dependency on x86 CPU architecture, then you must use Snowpark-optimized warehouses and use the RESOURCE_CONSTRAINT warehouse property, with CPU architecture x86. The stage hosting the file must be readable by the owner of the UDF. Also, ZIP files must be self-contained and not rely on any additional setup scripts to be executed. References: https://docs.snowflake.com/en/developer-guide/udf/python/udf-python-packages#importing-packages-through-a-snowflake-stage
Question 34 of 40
34. Question
Whats the result of the following sequence? (Choose one)
A natural join automatically joins tables on columns with the same name. In this case, both DataFrames share the column a, so the join is performed on a.
Because the join type is LEFT:
All rows from df1 are preserved
Matching rows from df2 are joined where possible
Non-matching rows from df2 result in NULL values
Row-by-row result:
a = 1 ? match found ? c = 7
a = 3 ? match found ? c = 8
a = 5 ? no match ? c = NULL
This produces the result shown in Option D, which is correct.
Natural joins in Snowpark support inner, left, right, and full joins and are a common source of exam questions due to their implicit join condition.
Incorrect
A natural join automatically joins tables on columns with the same name. In this case, both DataFrames share the column a, so the join is performed on a.
Because the join type is LEFT:
All rows from df1 are preserved
Matching rows from df2 are joined where possible
Non-matching rows from df2 result in NULL values
Row-by-row result:
a = 1 ? match found ? c = 7
a = 3 ? match found ? c = 8
a = 5 ? no match ? c = NULL
This produces the result shown in Option D, which is correct.
Natural joins in Snowpark support inner, left, right, and full joins and are a common source of exam questions due to their implicit join condition.
Unattempted
A natural join automatically joins tables on columns with the same name. In this case, both DataFrames share the column a, so the join is performed on a.
Because the join type is LEFT:
All rows from df1 are preserved
Matching rows from df2 are joined where possible
Non-matching rows from df2 result in NULL values
Row-by-row result:
a = 1 ? match found ? c = 7
a = 3 ? match found ? c = 8
a = 5 ? no match ? c = NULL
This produces the result shown in Option D, which is correct.
Natural joins in Snowpark support inner, left, right, and full joins and are a common source of exam questions due to their implicit join condition.
Question 35 of 40
35. Question
What are the lsuffix and rsuffix arguments do in a join DataFrame method? (choose one)
What will happen when you execute the following chain? (choose one) df1.filter(df1.a == 1 ).join(df2, df1.a == df2.a ).select(df1.a.alias(“a“), df1.b, df2.c)
What is the Snowpark Python local testing framework? (choose one)
Correct
The Snowpark Python local testing framework is an emulator that allows you to create and operate on Snowpark Python DataFrames locally without connecting to a Snowflake account. You can use the local testing framework to test your DataFrame operations on your development machine or in a CI (continuous integration) pipeline before deploying code changes to your account. The API is the same, so you can run your tests either locally or against a Snowflake account without making code changes. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/testing-locally
Incorrect
The Snowpark Python local testing framework is an emulator that allows you to create and operate on Snowpark Python DataFrames locally without connecting to a Snowflake account. You can use the local testing framework to test your DataFrame operations on your development machine or in a CI (continuous integration) pipeline before deploying code changes to your account. The API is the same, so you can run your tests either locally or against a Snowflake account without making code changes. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/testing-locally
Unattempted
The Snowpark Python local testing framework is an emulator that allows you to create and operate on Snowpark Python DataFrames locally without connecting to a Snowflake account. You can use the local testing framework to test your DataFrame operations on your development machine or in a CI (continuous integration) pipeline before deploying code changes to your account. The API is the same, so you can run your tests either locally or against a Snowflake account without making code changes. References: https://docs.snowflake.com/en/developer-guide/snowpark/python/testing-locally
Question 39 of 40
39. Question
What would go into an appropriate PyTest fixture when testing Snowpark? (choose one)
Correct
Comparing actual with expected values usually constitute unit tests, for connected or disconnected parts of code. Integration tests are also special tests with connected Snowflake accounts. In a PyTest fixture you usually pass some reusable code like connecting to Snowflake, through a Python connection or Snowpark session. For example: import pytest from project.utils import get_env_var_config from snowflake.snowpark.session import Session @pytest.fixture def session() -> Session: return Session.builder.configs(get_env_var_config()).create() References: https://docs.snowflake.com/en/developer-guide/snowpark/python/tutorials/testing-tutorial#create-a-pytest-fixture-for-the-snowflake-session
Incorrect
Comparing actual with expected values usually constitute unit tests, for connected or disconnected parts of code. Integration tests are also special tests with connected Snowflake accounts. In a PyTest fixture you usually pass some reusable code like connecting to Snowflake, through a Python connection or Snowpark session. For example: import pytest from project.utils import get_env_var_config from snowflake.snowpark.session import Session @pytest.fixture def session() -> Session: return Session.builder.configs(get_env_var_config()).create() References: https://docs.snowflake.com/en/developer-guide/snowpark/python/tutorials/testing-tutorial#create-a-pytest-fixture-for-the-snowflake-session
Unattempted
Comparing actual with expected values usually constitute unit tests, for connected or disconnected parts of code. Integration tests are also special tests with connected Snowflake accounts. In a PyTest fixture you usually pass some reusable code like connecting to Snowflake, through a Python connection or Snowpark session. For example: import pytest from project.utils import get_env_var_config from snowflake.snowpark.session import Session @pytest.fixture def session() -> Session: return Session.builder.configs(get_env_var_config()).create() References: https://docs.snowflake.com/en/developer-guide/snowpark/python/tutorials/testing-tutorial#create-a-pytest-fixture-for-the-snowflake-session
Question 40 of 40
40. Question
Which of the following is a legit call for a Snowpark DataFrame? (choose one)
Correct
group_by_grouping_sets performs a SQL GROUP BY GROUPING SETS. on the DataFrame. A proper call will create a GroupingSets object. GROUP BY GROUPING SETS is an extension of the GROUP BY clause that allows computing multiple GROUP BY clauses in a single statement. The group set is a set of dimension columns. GROUP BY GROUPING SETS is equivalent to the UNION of two or more GROUP BY operations in the same result set. References: https://docs.snowflake.com/developer-guide/snowpark/reference/python/latest/snowpark/api/snowflake.snowpark.DataFrame.group_by_grouping_sets
Incorrect
group_by_grouping_sets performs a SQL GROUP BY GROUPING SETS. on the DataFrame. A proper call will create a GroupingSets object. GROUP BY GROUPING SETS is an extension of the GROUP BY clause that allows computing multiple GROUP BY clauses in a single statement. The group set is a set of dimension columns. GROUP BY GROUPING SETS is equivalent to the UNION of two or more GROUP BY operations in the same result set. References: https://docs.snowflake.com/developer-guide/snowpark/reference/python/latest/snowpark/api/snowflake.snowpark.DataFrame.group_by_grouping_sets
Unattempted
group_by_grouping_sets performs a SQL GROUP BY GROUPING SETS. on the DataFrame. A proper call will create a GroupingSets object. GROUP BY GROUPING SETS is an extension of the GROUP BY clause that allows computing multiple GROUP BY clauses in a single statement. The group set is a set of dimension columns. GROUP BY GROUPING SETS is equivalent to the UNION of two or more GROUP BY operations in the same result set. References: https://docs.snowflake.com/developer-guide/snowpark/reference/python/latest/snowpark/api/snowflake.snowpark.DataFrame.group_by_grouping_sets
X
SkillCertPro Wishes you all the best for your exam.