-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Updated read_html to add option #39925
Conversation
Adds optional boolean parameter "remove_whitespace" to skip the remove_whitespace functionality. Defaults to true to support backwards compatibility. See pandas-dev#24766
Hello @Derekt2! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2021-02-26 18:43:17 UTC |
pandas/io/html.py
Outdated
@@ -73,7 +73,7 @@ def _importers(): | |||
_RE_WHITESPACE = re.compile(r"[\r\n]+|\s{2,}") | |||
|
|||
|
|||
def _remove_whitespace(s: str, regex=_RE_WHITESPACE) -> str: | |||
def _remove_whitespace(s: str, regex=_RE_WHITESPACE, remove_whitespace=True) -> str: |
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.
seems a bit odd to define a boolean parameter input to a function named remove_whitespace
if it really wants to remove_whitespace
or not.
Better to do a conditional check before the function is called, and either call it or don't.
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.
excellent point. updated the pull to reflect this suggestion
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.
needs tests
Added the |
@Derekt2 this needs some tests. |
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
Adds optional boolean parameter "remove_whitespace" to skip the remove_whitespace functionality. Defaults to true to support backwards compatibility. See #24766