Skip to content
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

BUG: Fix error message for invalid HTML flavor #23550

Merged
merged 1 commit into from
Nov 8, 2018

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Nov 7, 2018

The flavors were not rendering properly in the string formatting.

Closes #23549.
Follow-up to #17660.

The flavors were not rendering properly in the
string formatting.

Closes pandas-devgh-23549.
Follow-up to pandas-devgh-17660.
@gfyoung gfyoung added Bug Error Reporting Incorrect or improved errors from pandas IO HTML read_html, to_html, Styler.apply, Styler.applymap labels Nov 7, 2018
@pep8speaks
Copy link

Hello @gfyoung! Thanks for submitting the PR.

msg = r"\{" + flavor + r"\} is not a valid set of flavors"

with tm.assert_raises_regex(ValueError, msg):
read_html(url, "google", flavor=flavor)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had a test for invalid flavors, but we were not checking the error message 😮

Should definitely discourage use of pytest.raises (with no match argument) unless there is a good reason for our not wanting to check the error message.

@codecov
Copy link

codecov bot commented Nov 7, 2018

Codecov Report

Merging #23550 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #23550   +/-   ##
=======================================
  Coverage   92.24%   92.24%           
=======================================
  Files         161      161           
  Lines       51224    51224           
=======================================
  Hits        47254    47254           
  Misses       3970     3970
Flag Coverage Δ
#multiple 90.63% <100%> (ø) ⬆️
#single 42.28% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/html.py 91.25% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28a42da...edfe3a0. Read the comment docs.

@TomAugspurger TomAugspurger merged commit 8212001 into pandas-dev:master Nov 8, 2018
@TomAugspurger
Copy link
Contributor

Thanks.

@gfyoung gfyoung deleted the invalid-flavor-msg branch November 8, 2018 00:16
@gfyoung gfyoung added this to the 0.24.0 milestone Nov 8, 2018
thoo added a commit to thoo/pandas that referenced this pull request Nov 10, 2018
…fixed

* upstream/master: (47 commits)
  CLN: remove values attribute from datetimelike EAs (pandas-dev#23603)
  DOC/CI: Add linting to rst files, and fix issues (pandas-dev#23381)
  PERF: Speeds up creation of Period, PeriodArray, with Offset freq (pandas-dev#23589)
  PERF: define is_all_dates to shortcut inadvertent copy when slicing an IntervalIndex (pandas-dev#23591)
  TST: Tests and Helpers for Datetime/Period Arrays (pandas-dev#23502)
  Update description of Index._values/values/ndarray_values (pandas-dev#23507)
  Fixes to make validate_docstrings.py not generate warnings or unwanted output (pandas-dev#23552)
  DOC: Added note about groupby excluding Decimal columns by default (pandas-dev#18953)
  ENH: Support writing timestamps with timezones with to_sql (pandas-dev#22654)
  CI: Auto-cancel redundant builds (pandas-dev#23523)
  Preserve EA dtype in DataFrame.stack (pandas-dev#23285)
  TST: Fix dtype mismatch on 32bit in IntervalTree get_indexer test (pandas-dev#23468)
  BUG: raise if invalid freq is passed (pandas-dev#23546)
  remove uses of (ts)?lib.(NaT|iNaT|Timestamp) (pandas-dev#23562)
  BUG: Fix error message for invalid HTML flavor (pandas-dev#23550)
  ENH: Support EAs in Series.unstack (pandas-dev#23284)
  DOC: Updating DataFrame.join docstring (pandas-dev#23471)
  TST: coverage for skipped tests in io/formats/test_to_html.py (pandas-dev#22888)
  BUG: Return KeyError for invalid string key (pandas-dev#23540)
  BUG: DatetimeIndex slicing with boolean Index raises TypeError (pandas-dev#22852)
  ...
JustinZhengBC pushed a commit to JustinZhengBC/pandas that referenced this pull request Nov 14, 2018
The flavors were not rendering properly in the
string formatting.

Closes pandas-devgh-23549.
Follow-up to pandas-devgh-17660.
tm9k1 pushed a commit to tm9k1/pandas that referenced this pull request Nov 19, 2018
The flavors were not rendering properly in the
string formatting.

Closes pandas-devgh-23549.
Follow-up to pandas-devgh-17660.
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
The flavors were not rendering properly in the
string formatting.

Closes pandas-devgh-23549.
Follow-up to pandas-devgh-17660.
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
The flavors were not rendering properly in the
string formatting.

Closes pandas-devgh-23549.
Follow-up to pandas-devgh-17660.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Error Reporting Incorrect or improved errors from pandas IO HTML read_html, to_html, Styler.apply, Styler.applymap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants