-
Notifications
You must be signed in to change notification settings - Fork 119
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 #1828
base: main
Are you sure you want to change the base?
Conversation
@@ -25,6 +25,7 @@ | |||
Optional, | |||
Tuple, | |||
Type, | |||
TypedDict, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypedDict and total arguments are supported starting with Python 3.8.
https://docs.python.org/3.8/library/typing.html?highlight=typeddict#typing.TypedDict
@overload | ||
def copy_into_location( | ||
self, | ||
location: str, | ||
*, | ||
partition_by: Optional[ColumnOrSqlExpr] = None, | ||
file_format_name: Optional[str] = None, | ||
file_format_type: Optional[str] = None, | ||
format_type_options: Optional[Dict[str, str]] = None, | ||
header: bool = False, | ||
statement_params: Optional[Dict[str, str]] = None, | ||
block: bool = True, | ||
**copy_options: Unpack[CopyOptions], | ||
) -> Union[List[Row], AsyncJob]: | ||
... # pragma: no cover | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type hint of a function definition without overload did not work with csv method or json method, and a pylancen error occurred, so I also defined it with overload.
4431afc
to
3c6b852
Compare
@sfc-gh-yuwang, @sfc-gh-jrose, @sfc-gh-aalam I hope you're doing well. I wanted to kindly check in on the status of the pull request. I know you must be busy, but if you have a moment to take a look, I’d really appreciate any feedback or comments you might have. |
overwrite: bool | ||
single: bool | ||
max_file_size: float | ||
include_query_id: bool | ||
detailed_output: bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think value in string form is also allowed?
also are the keys case sensitive?
if I have a copy options looking like
option_dict = {"OVERWRITE": "TRUE"}
would pylance complain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sfc-gh-aling
I missed checking this point.
Keys are not case-sensitive.
I have corrected this on my end. (575cb81)
3c6b852
to
bacefbe
Compare
bacefbe
to
575cb81
Compare
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1417060
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.