This line:
https://github.com/python-visualization/folium/blob/f05f3ce9b3d71f87a0738f3c8c1236b933e497a9/folium/features.py#L1112
Provokes this ValueError to be raised, not only when key_of_x is None but also when key_of_x == 0 (which I think is a perfectly valid value for a key):
https://github.com/python-visualization/folium/blob/f05f3ce9b3d71f87a0738f3c8c1236b933e497a9/folium/features.py#L1113
Shouldn't this line be if key_of_x is None:?
Yes! Pet peeve of mine, but I like explicit checks for None, this is why. Do you want to make a PR? Maybe add a test?
~In the docstring it says key_on should be a string or None. Should we change that into that it can also be an int?~ That doesn't make sense, we're talking about the key_of_x value here, not key_on.
I've just made a PR. You might want to check the test I made though since I was not sure how to test the ValueError not being raised.
Most helpful comment
Yes! Pet peeve of mine, but I like explicit checks for None, this is why. Do you want to make a PR? Maybe add a test?
~In the docstring it says
key_onshould be a string or None. Should we change that into that it can also be an int?~ That doesn't make sense, we're talking about thekey_of_xvalue here, notkey_on.