Open sortmanns opened 11 months ago
I ran into this issue with Pylance. There seems to be an inconsistency between the type signature and the actual source code definition. The type signature shows clustering_keys
as a mandatory parameter with no default value, whereas the source code has the parameter defined as Optional
and with the default value of None
.
Please answer these questions before submitting your issue. Thanks!
What version of Python are you using?
Python 3.9.18
What operating system and processor architecture are you using?
macOS-12.5.1-x86_64-i386-64bit
What are the component versions in the environment (
pip freeze
)?mypy==1.5.1 mypy-extensions==1.0.0 snowflake-connector-python==3.3.0b1 snowflake-snowpark-python==1.8.0
What did you do?
Code:
def store_table(df: DataFrame, destination: str): df.write.saveAsTable(destination)
store_table.py: note: In function "store_table": store_table.py:5:5: error: No overload variant matches argument type "str" [call-overload] df.write.saveAsTable(destination) ^
~~~~~~~~ store_table.py:5:5: note: Possible overload variants: store_table.py:5:5: note: def (table_name: Union[str, Iterable[str]], , mode: Optional[str] = ..., column_order: str = ..., create_temp_table: bool = ..., table_type: Literal['', 'temp', 'temporary', 'transient'] = ..., clustering_keys: Iterable[Column], statement_params: Optional[dict[str, str]] = ..., block: bool = ...) -> None store_table.py:5:5: note: def (table_name: Union[str, Iterable[str]], , mode: Optional[str] = ..., column_order: str = ..., create_temp_table: bool = ..., table_type: Literal['', 'temp', 'temporary', 'transient'] = ..., clustering_keys: Iterable[Column], statement_params: Optional[dict[str, str]] = ..., block: bool = ...) -> AsyncJob Found 1 error in 1 file (checked 1 source file)