snowflakedb / snowflakedb/snowflake-connector-python
SNOW-720936: Arrays with nulls return invalid JSON for null values
Open
@sfc-gh-mkeller is already working on this.
Since Mar 29, 2023.
feature
status-triage_done
triaged
- Dominant language
- Python
- Stars
- 730
- Forks
- 574
- Avg merge
- 5h 45m
- Merged PRs (30d)
- 16
Description
- What version of Python are you using?
❯ python --version --version
Python 3.10.9 (main, Dec 6 2022, 18:44:57) [GCC 11.3.0]
- What operating system and processor architecture are you using?
❯ python -c 'import platform; print(platform.platform())'
Linux-5.15.86-x86_64-with-glibc2.35
- What are the component versions in the environment (
pip freeze)?
❯ poetry show snowflake-sqlalchemy
name : snowflake-sqlalchemy
version : 1.4.4
description : Snowflake SQLAlchemy Dialect
❯ poetry show snowflake-connector-python
name : snowflake-connector-python
version : 2.9.0
description : Snowflake Connector for Python
- What did you do?
In [19]: import sqlalchemy as sa
In [20]: con = sa.create_engine(...)
In [21]: [(row,)] = con.execute('select array_construct(1,2,null)')
In [22]: row
Out[22]: '[\n 1,\n 2,\n undefined\n]'
In [23]: import json
In [24]: json.loads(row)
-
What did you expect to see?
I think I'd expect to see
null(and thenNonefrom the result of the parse done byjson.loads).nullis a valid JSON value whileundefinedis not. -
Can you set logging to DEBUG and collect the logs?
I don't think doing this helps, as the query succeeds.
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.