Open tekumara opened 2 years ago
According to the function documentation, None
does have legit meaning, so I'm not sure if removing it is the correct behavior.
Yeh None is returned when the caller provides an empty command:
Could this be a ValueError exception instead perhaps?
From the python docs:
exception ValueError Raised when an operation or function receives an argument that has the right type but an inappropriate value, and the situation is not described by a more precise exception such as IndexError.
Could this be a ValueError exception instead perhaps?
This is going to be a behavior change, but it might not be a bad idea. WDYT? @sfc-gh-mkeller
This would be pretty neat. Is there any update on this @sfc-gh-sfan?
What is the current behavior?
SnowflakeCursor execute returns
SnowflakeCursor | None
.This means every excecute needs to be checked for None. eg:
If the check isn't performed then pyright/vscode will error with
Or the application will fail at runtime.
What is the desired behavior?
cursor.execute does not return None for any cases, therefore avoiding the need for a None check.
How would this improve
snowflake-connector-python
?This would enable the more fluent syntax without the need for a check:
References, Other Background
From the pyright docs: