Skip to content

Commit eb13fe1

Browse files
authored
Deprecate hover_formatters (#1637)
1 parent 89be97a commit eb13fe1

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

doc/ref/deprecations.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ List of currently deprecated APIs:
44

55
| Warning | Description |
66
|-|-|
7+
| `DeprecationWarning` since `0.12.0` | `hover_formatters` argument, use `hover_tooltips` instead. |
78
| `FutureWarning` since `0.12.0` | Passing DuckDB objects to `hvplot.plotting.plot`, use `import hvplot.duckdb` instead. |
89
| `FutureWarning` since `0.12.0` | `debug` argument |
910

hvplot/converter.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,9 @@ class HoloViewsConverter:
361361
include all columns (including indexes if ``use_index=True``).
362362
hover_formatters : dict or None, default=None
363363
A dict of formatting options for the hover tooltip.
364+
365+
.. deprecated 0.12
366+
User ``hover_tooltips`` instead.
364367
hover_tooltips : list[str] or list[tuple] or None, default=None
365368
A list of dimensions to be displayed in the hover tooltip.
366369
toolbar : str or bool or None, optional
@@ -1151,6 +1154,12 @@ def __init__(
11511154
if hover_tooltips:
11521155
plot_opts['hover_tooltips'] = hover_tooltips
11531156
if hover_formatters:
1157+
warnings.warn(
1158+
'hover_formatters has been deprecated and will be removed '
1159+
'in a future version. Use hover_tooltips instead.',
1160+
DeprecationWarning,
1161+
stacklevel=_find_stack_level(),
1162+
)
11541163
plot_opts['hover_formatters'] = hover_formatters
11551164
if toolbar is not _Undefined:
11561165
if toolbar is False:

hvplot/tests/testdeprecations.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ def test_plotting_plot_duckdb():
2222
relation = duckdb.from_df(makeDataFrame(), connection=connection)
2323
with pytest.warns(FutureWarning):
2424
plot(relation, 'line')
25+
26+
27+
def test_converter_argument_hover_formatters():
28+
df = pd.DataFrame({'x': [0, 1], 'y': [0, 1]})
29+
with pytest.warns(DeprecationWarning):
30+
HoloViewsConverter(df, 'x', 'y', hover_formatters={'@{y}': 'printf'})

0 commit comments

Comments
 (0)