-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: Add type check for encoding_errors in pd.read_csv #59075
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
Changes from 1 commit
3bab38b
31444ea
78e7ade
5434727
f948b62
d226cc2
d9f5583
1305cfd
efec1b5
5dca760
be5215a
6411631
984e5b8
e9f9fa5
6f813b0
5fea382
44baa46
5e08d4d
d422b5e
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 | ||||
---|---|---|---|---|---|---|
|
@@ -1413,6 +1413,13 @@ def _make_engine( | |||||
raise ValueError( | ||||||
f"Unknown engine: {engine} (valid options are {mapping.keys()})" | ||||||
) | ||||||
|
||||||
errors = self.options.get("encoding_errors", "strict") | ||||||
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. Could you move this logic into 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. Okay, I have moved it into |
||||||
if not isinstance(errors, str) and errors is not None: | ||||||
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.
Suggested change
|
||||||
raise ValueError( | ||||||
f"encoding_errors must be a string, got {type(errors).__name__}" | ||||||
) | ||||||
|
||||||
if not isinstance(f, list): | ||||||
# open file here | ||||||
is_text = True | ||||||
|
@@ -1437,7 +1444,7 @@ def _make_engine( | |||||
compression=self.options.get("compression", None), | ||||||
memory_map=self.options.get("memory_map", False), | ||||||
is_text=is_text, | ||||||
errors=self.options.get("encoding_errors", "strict"), | ||||||
errors=errors, | ||||||
storage_options=self.options.get("storage_options", None), | ||||||
) | ||||||
assert self.handles is not None | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.