10000 BUG: styler.format options and validator tests by attack68 · Pull Request #43341 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: styler.format options and validator tests #43341

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

Merged
merged 11 commits into from
Sep 6, 2021
Prev Previous commit
Next Next commit
CI: Revive Banklist Tests (#42889)
(cherry picked from commit 9981172)
  • Loading branch information
lithomas1 authored and attack68 committed Sep 1, 2021
commit fe30ac7b7ddd75cfc7e860211199f896b24c5f18
12 changes: 7 additions & 5 deletions doc/source/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2502,14 +2502,16 @@ Read a URL with no options:

.. ipython:: python

url = (
"https://raw.githubusercontent.com/pandas-dev/pandas/master/"
"pandas/tests/io/data/html/spam.html"
)
url = "https://www.fdic.gov/resources/resolutions/bank-failures/failed-bank-list"
dfs = pd.read_html(url)
dfs

Read in the content of the "banklist.html" file and pass it to ``read_html``
.. note::

The data from the above URL changes every Monday so the resulting data above
and the data below may be slightly different.

Read in the content of the file from the above URL and pass it to ``read_html``
as a string:

.. ipython:: python
Expand Down
26 changes: 18 additions & 8 deletions pandas/tests/io/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,28 +134,38 @@ def test_to_html_compat(self):
res = self.read_html(out, attrs={"class": "dataframe"}, index_col=0)[0]
tm.assert_frame_equal(res, df)

@pytest.mark.xfail(reason="Html file was removed")
@tm.network
def test_banklist_url_positional_match(self):
url = "https://www.fdic.gov/bank/individual/failed/banklist.html"
url = "http://www.fdic.gov/resources/resolutions/bank-failures/failed-bank-list/index.html" # noqa E501
# Passing match argument as positional should cause a FutureWarning.
with tm.assert_produces_warning(FutureWarning):
df1 = self.read_html(
url, "First Federal Bank of Florida", attrs={"id": "table"}
# lxml cannot find attrs leave out for now
url,
"First Federal Bank of Florida", # attrs={"class": "dataTable"}
)
with tm.assert_produces_warning(FutureWarning):
df2 = self.read_html(url, "Metcalf Bank", attrs={"id": "table"})
# lxml cannot find attrs leave out for now
df2 = self.read_html(
url,
"Metcalf Bank",
) # attrs={"class": "dataTable"})

assert_framelist_equal(df1, df2)

@pytest.mark.xfail(reason="Html file was removed")
@tm.network
def test_banklist_url(self):
url = "https://www.fdic.gov/bank/individual/failed/banklist.html"
url = "http://www.fdic.gov/resources/resolutions/bank-failures/failed-bank-list/index.html" # noqa E501
df1 = self.read_html(
url, match="First Federal Bank of Florida", attrs={"id": "table"}
# lxml cannot find attrs leave out for now
url,
match="First Federal Bank of Florida", # attrs={"class": "dataTable"}
)
df2 = self.read_html(url, match="Metcalf Bank", attrs={"id": "table"})
# lxml cannot find attrs leave out for now
df2 = self.read_html(
url,
match="Metcalf Bank",
) # attrs={"class": "dataTable"})

assert_framelist_equal(df1, df2)

Expand Down
0