Skip to content

Commit

Permalink
Fix pandas FutureWarning
Browse files Browse the repository at this point in the history
```
.venv/lib/python3.10/site-packages/searvey/ioc.py:147: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.
  df = pd.read_html(html)[0]
```
  • Loading branch information
pmav99 committed Oct 31, 2023
1 parent 60941d3 commit a830fed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion searvey/ioc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from __future__ import annotations

import functools
import io
import logging
import warnings
from typing import Optional
Expand Down Expand Up @@ -144,7 +145,7 @@ def get_ioc_stations_by_output(output: str, skip_table_rows: int) -> pd.DataFram
table_contents = "\n".join(str(tr) for tr in trs[skip_table_rows:])
html = f"<table>{table_contents}</table>"
logger.debug("Created table: %s", url)
df = pd.read_html(html)[0]
df = pd.read_html(io.StringIO(html))[0]
logger.debug("Parsed table: %s", url)
df.columns = IOC_STATIONS_COLUMN_NAMES[output]
df = df.drop(columns="view")
Expand Down

0 comments on commit a830fed

Please sign in to comment.