Skip to content

SNOW-752200: Invalide None values in fetchmany and fetchall introduced in 3.0.1 #1464

Closed
@sodul

Description

@sodul
  1. What version of Python are you using?
> python --version --version
Python 3.11.2 (main, Feb 13 2023, 17:10:22) [Clang 14.0.0 (clang-1400.0.29.202)]
  1. What operating system and processor architecture are you using?
> python -c 'import platform; print(platform.platform())'
macOS-13.2.1-arm64-arm-64bit
  1. What are the component versions in the environment (pip freeze)?
> python -m pip freeze | grep -E 'mypy=|snowflake'
mypy==1.0.1
snowflake-connector-python==3.0.1
  1. What did you do?

Ran mypy against our code using snowflake-connector-python

  1. What did you expect to see?

    No error

  2. Can you set logging to DEBUG and collect the logs?

N/A

In the 3.0.1 release the fetchmany and fetchall method got their return types updated to list[dict | tuple | None]. This is actually incorrect since they both contain logic to exclude row values that are None. Our own code is expecting lists of dicts or tuples explicitly and the possibility of getting None row is breaking mypy.

The return types should be list[dict | tuple].

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions