Skip to content

Commit 3964193

Browse files
authored
Remove deprecated choropleth method (#1684)
1 parent 1b091df commit 3964193

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

folium/folium.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"""
55

66
import time
7-
import warnings
87
import webbrowser
98

109
from branca.element import Element, Figure, MacroElement
@@ -457,21 +456,6 @@ def fit_bounds(
457456
)
458457
)
459458

460-
def choropleth(self, *args, **kwargs):
461-
"""Call the Choropleth class with the same arguments.
462-
463-
This method may be deleted after a year from now (Nov 2018).
464-
"""
465-
warnings.warn(
466-
"The choropleth method has been deprecated. Instead use the new "
467-
"Choropleth class, which has the same arguments. See the example "
468-
"notebook 'GeoJSON_and_choropleth' for how to do this.",
469-
FutureWarning,
470-
)
471-
from folium.features import Choropleth
472-
473-
self.add_child(Choropleth(*args, **kwargs))
474-
475459
def keep_in_front(self, *args):
476460
"""Pass one or multiple layers that must stay in front.
477461

tests/test_folium.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -385,17 +385,6 @@ def test_choropleth_geopandas_str(self):
385385
assert '"fillColor":"a_random_color","fillOpacity":0.123454321' not in out_str
386386
assert '"fillOpacity":0.543212345' in out_str
387387

388-
def test_choropleth_warning(self):
389-
"""Test that the Map.choropleth method works and raises a warning."""
390-
self.setup()
391-
with open(os.path.join(rootpath, "us-counties.json")) as f:
392-
geo_data = json.load(f)
393-
with pytest.warns(FutureWarning):
394-
self.m.choropleth(geo_data)
395-
assert any(
396-
[isinstance(child, Choropleth) for child in self.m._children.values()]
397-
)
398-
399388
def test_tile_attr_unicode(self):
400389
"""Test tile attribution unicode"""
401390
m = folium.Map(location=[45.5236, -122.6750], tiles="test", attr="юникод")

0 commit comments

Comments
 (0)