Remove dead #map CSS rule from Map template - #2261
Open
B-bater26 wants to merge 1 commit into
Open
Conversation
The #map functioned as a selector, and the actual rendered ids of maps are formatted as map_<hash>. #{{ this.get_name() }} functions as the rule that handles map styles. python-visualization#2229 PR deleted this, but #map remained due to folium.py being reverted upstream prior to merging, so it still causes 2186 to fail. After removing #map from the HTML styles in folium.py, test 2186 works.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
In
folium.py, the#mapfunctioned as a selector. The actual rendered IDs of maps are formatted asmap_<hash>, so#mapnever references anything.#{{ this.get_name() }}functions as the rule that handles map styles, so the removal of#mapdoes not impact the actual map style.Also, a page using
<div id="map">would be forced to haveposition:absolutedue to this.Verification
I ran tests using three map configurations, and none of them returned with any html with
id="map". git grep -n on'id="map"',"'map'", and'id="map"' mainreturned no results, while git grep -n'id=.map.'referencedtests/test_issue_2186.py:98, which was a comment about the old rule being deleted.Previous PR
#2229 PR deleted this, but
#mapremained due to the removal being dropped by Kakarot35 when they restored folium.py to match upstream to resolve an unrelated issue about WebDriverWait. Due to this reversion,#mapstill causes 2186 (test_dead_map_id_rule_absent) to fail.Testing
After removing
#mapfrom the HTML styles in folium.py, test 2186 passes.pytest tests --ignore=tests/selenium --ignore=tests/playwright --ignore=tests/snapshotsreturned 260 passed tests and 4 failed ones. Prior to my fix, it returned 259 passed and 5 failed. All pre-commit hooks pass, and the 4 failures are unrelated. 3 are test_repr.py PNG tests and 1 is test_icon_invalid_marker_colors, which failed on both the modified and unmodified checkouts.Note: tests/selenium and tests/snapshots were not run locally, as selenium has no manager binary for Windows ARM64, but the CI covers both.