elastic / eland

Python Client and Toolkit for DataFrames, Big Data, Machine Learning and ETL in Elasticsearch
https://eland.readthedocs.io
Apache License 2.0
627 stars 98 forks source link

Fix missing method str.removeprefix in Python 3.8 #695

Closed bartbroere closed 1 month ago

bartbroere commented 1 month ago

Eland still supports Python 3.8, so str.removeprefix can be called and raise an AttributeError.

Once Eland drops Python 3.8 support this if/else can be removed (only keeping the code in the if).

bartbroere commented 1 month ago

I would use the slice and mention this can be replaced by removeprefix when we remove Python 3.8.

That sounds a bit less verbose indeed. I committed the suggestion.

pquentin commented 1 month ago

buildkite test this please

pquentin commented 1 month ago

buildkite test this please

pquentin commented 1 month ago

buildkite test this please