Check that key is a string before string compare

Fixes boolean indexing on GeoDataFrame