-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Labels
bugSomething isn't workingSomething isn't workinglocal testingLocal Testing issues/PRsLocal Testing issues/PRsstatus-triage_doneInitial triage done, will be further handled by the driver teamInitial triage done, will be further handled by the driver team
Description
Please answer these questions before submitting your issue. Thanks!
-
What version of Python are you using?
Python 3.11.0 (main, Jun 30 2025, 10:43:55) [Clang 17.0.0 (clang-1700.0.13.5)]
-
What are the Snowpark Python and pandas versions in the environment?
pandas==2.3.1
snowflake-snowpark-python==1.34.0
- What did you do?
When attempting to use explode() function in local testing, the below error is seen.
AttributeError: 'MockSelectStatement' object has no attribute 'snowflake_plan'
Here's a step by step repro -
>>> from snowflake.snowpark import Session
>>> from snowflake.snowpark.functions import explode
>>> session = Session.builder.config('local_testing', True).create()
>>> data = [
... {
... "foo": "bar",
... "my_array": ["one","two"]
... }
... ]
>>> df = session.create_dataframe(data, schema=["foo", "my_array"])
>>> df.show()
--------------------------
|"FOO" |"MY_ARRAY" |
--------------------------
|bar |['one', 'two'] |
--------------------------
>>> df.select("foo", explode("my_array")).show()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ksreekandath/.pyenv/versions/case_01077035/lib/python3.11/site-packages/snowflake/snowpark/_internal/telemetry.py", line 368, in wrap
r = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/ksreekandath/.pyenv/versions/case_01077035/lib/python3.11/site-packages/snowflake/snowpark/_internal/utils.py", line 1120, in call_wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/ksreekandath/.pyenv/versions/case_01077035/lib/python3.11/site-packages/snowflake/snowpark/dataframe.py", line 1634, in select
new_cols, alias_cols = _get_cols_after_explode_join(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ksreekandath/.pyenv/versions/case_01077035/lib/python3.11/site-packages/snowflake/snowpark/table_function.py", line 327, in _get_cols_after_explode_join
plan = select_statement.select([func.col._named()]).snowflake_plan
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'MockSelectStatement' object has no attribute 'snowflake_plan'
>>>
- What did you expect to see?
>>> from snowflake.snowpark import Session
from snowflake.snowpark.functions import explode
>>> session=Session.builder.config("connection_name","XTB17692").create()
>>> data = [
... {
... "foo": "bar",
... "my_array": ["one","two"]
... }
... ]
>>> df = session.create_dataframe(data, schema=["foo", "my_array"])
>>> df.show()
----------------------
|"FOO" |"MY_ARRAY" |
----------------------
|bar |[ |
| | "one", |
| | "two" |
| |] |
----------------------
>>> df.select("foo", explode("my_array")).show()
-------------------
|"FOO" |"VALUE" |
-------------------
|bar |"one" |
|bar |"two" |
-------------------
>>>
>>>
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinglocal testingLocal Testing issues/PRsLocal Testing issues/PRsstatus-triage_doneInitial triage done, will be further handled by the driver teamInitial triage done, will be further handled by the driver team