Please take a look at #3062 for context.
This issue reminds us to remove the workaround when we require xarray>=v2024.02. Following the SPEC 0 policy, we should bump to xarray>=v2024.02 in February 2026, so the target PyGMT release is likely v0.19.0.