snowflakedb / snowflakedb/snowpark-python
SNOW-1006168: Snowpark function `array_agg` converts data types to string
@sfc-gh-ashahi is already working on this.
Since Mar 13, 2024.
- Dominant language
- Python
- Stars
- 341
- Forks
- 155
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 27
Description
Please answer these questions before submitting your issue. Thanks!
-
What version of Python are you using?
Snowsight Python notebook with snowflake-snowpark-python 1.11.1
-
What operating system and processor architecture are you using?
Snowsight Python notebook with snowflake-snowpark-python 1.11.1
-
What are the component versions in the environment (
pip freeze)?Snowsight Python notebook with snowflake-snowpark-python 1.11.1
-
What did you do?
I used the function array_agg and a column of big ints.
import snowflake.snowpark as snowpark
from snowflake.snowpark.functions import col, array_agg
def main(session: snowpark.Session):
df = session.create_dataframe([[1], [2], [3], [1]], schema=["a"])
print("Initial dtypes:", df.dtypes)
df = df.select(array_agg("a", False).alias("result"))
print("After array_agg dtypes:", df.dtypes)
return df
-
What did you expect to see?
I hoped to get a single row and a column with dtype
array<bigint>. Instead I gotarray<string>.
The PY output when runing the code above is:
Initial dtypes: [('A', 'bigint')]
After array_agg dtypes: [('RESULT', 'array<string>')]
Why array<string>, this is crazy, but here is my number! as string? 🎤
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.