snowflake-connector-python
snowflake-connector-python copied to clipboard
Enable receiving variant and array types in json
-
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
-
Fill out the following pre-review checklist:
- [x] I am adding a new automated test(s) to verify correctness of my new code
- [ ] I am adding new logging messages
- [ ] I am adding a new telemetry message
- [ ] I am modifying authorization mechanisms
- [ ] I am adding new credentials
- [ ] I am modifying OCSP code
- [ ] I am adding a new dependency
-
Please describe how your code solves the related issue.
Use
json.loadsto try to load array and variant types in the connector. Some observed behaviors:- If
parse_jsonis used on a list ending with a comma, for example[1, 2, 3,], Snowflake stores it as[1, 2, 3, undefined] - If
nullis passed toarray_construct, it is stored as undefined in the array. -
json.loadscannot parseundefinedelements in VARIANT or ARRAY types.
- If
Codecov Report
Merging #1371 (303384d) into main (580c0ae) will decrease coverage by
0.47%. The diff coverage is27.14%.
@@ Coverage Diff @@
## main #1371 +/- ##
==========================================
- Coverage 81.29% 80.82% -0.48%
==========================================
Files 61 62 +1
Lines 8553 8619 +66
Branches 1262 1274 +12
==========================================
+ Hits 6953 6966 +13
- Misses 1281 1334 +53
Partials 319 319
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/snowflake/connector/json_decoder.py | 17.74% <17.74%> (ø) |
|
| src/snowflake/connector/converter.py | 89.89% <100.00%> (+0.10%) |
:arrow_up: |
| src/snowflake/connector/cache.py | 84.51% <0.00%> (-0.68%) |
:arrow_down: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Is this PR still viable? Would be happy to look into any remaining issues to get this merged.