How can I plot a choropleth map from a dataframe?

This is a function definition. The function is used in the next step. It seems that the function transforms Polygons between two different formats. ESRI seems to be a company and probably this is some kind of proprietary data format for polygins (just guessing here).

It would be better you find some small dataset to experiment with, maybe a subset of your data. With that you could create a MWE (Please read: make it easier to help you) and from this I could help with real VegaLite code.