-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNOW-1417060: Pylance throws errors when using copy_options with copy_into_location method #1574
Comments
I made a mistake with this PR(#1372). The copy_options of the copy_into_location method was supposed to be of type Optional[Any], but I changed it to Optional[Dict[str, Any]]. |
Hello @Yoshi-Egawa , The PR #1372 already merged, so you would like to undo the changes and propose a new fix ( The copy_options of the copy_into_location method was supposed to be of type Optional[Any], but I changed it to Optional[Dict[str, Any]].) ? Regards, |
Hello @sfc-gh-sghosh , You're absolutely right. My apologies for the error in PR #1372. I've reverted the incorrect changes and opened a new pull request (PR #1575) with a more robust type definition for copy_options. This PR replaces the previous copy_options type with a stricter TypedDict definition, ensuring more accurate and robust type checking. Thanks for catching that! |
Hello @Yoshi-Egawa, Thanks for submitting the PR (PR #1575). Regards, |
Hello everyone. I'm using: The On Snowflake side, the COPY statement itself gets translated like this:
This produces an error since this is not the expected way to provide copy options. In PR 1575 the type was supposed to be changed but this PR never got merged. It's closed. |
Hello @sfc-gh-sghosh , Apologies, but it seems that I accidentally closed PR #1575. I’ve created a new PR (#1828) for the same changes. Could you kindly take a look at the new PR when you have a moment? Thank you for your understanding and support! Best regards, |
Please answer these questions before submitting your issue. Thanks!
What version of Python are you using?
Python 3.11.8
What operating system and processor architecture are you using?
linux 64
What are the component versions in the environment (
pip freeze
)?snowflake-snowpark-python==1.16.0
What did you do?
Let's say you have a custom class like the one at the bottom (a minimal example to check for errors).
When linting this file (Pylance v2024.4.1) errors appear.
What did you expect to see?
The type of copy_options in the copy_into_location method is Optional[str], but the type of copy_options in the CopyIntoLocationNode class used in the copy_into_location method is Dict[str, Any]. Consequently, to align the types, the copy_options in the copy_into_location method should be of type Optional[Any].
Can you set logging to DEBUG and collect the logs?
This is not a RunTime error, so I think this will not give us any extra information.
The text was updated successfully, but these errors were encountered: