-
Notifications
You must be signed in to change notification settings - Fork 118
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-1300150:Automatic schema inference for CSV loading option unclear #1521
Changes from 6 commits
0bf5b50
02627dd
8d469b6
c1471fd
aebc0c1
3560a35
674b9d0
11ece09
5865bc9
1eda045
7d27919
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -393,9 +393,6 @@ def csv(self, path: str) -> DataFrame: | |
self._file_path = path | ||
self._file_type = "CSV" | ||
|
||
# infer schema is set to false by default | ||
if "INFER_SCHEMA" not in self._cur_options: | ||
self._cur_options["INFER_SCHEMA"] = False | ||
schema_to_cast, transformations = None, None | ||
|
||
if not self._user_schema: | ||
|
@@ -421,6 +418,7 @@ def csv(self, path: str) -> DataFrame: | |
schema_to_cast = [("$1", "C1")] | ||
transformations = [] | ||
else: | ||
self._cur_options["INFER_SCHEMA"] = False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this condition will already be true if we reach the else branch, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, if we reach here, user must have provide a schema, in that way, we should use what user provide and turn off infer_schema |
||
schema = self._user_schema._to_attributes() | ||
|
||
metadata_project, metadata_schema = self._get_metadata_project_and_schema() | ||
|
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.
nit