It is useful to have a different data_dir per env
and the feature as requested
platformio-core#4126
for override at env level has not been implemented.
That feature request did however contain WISDOM for how to specify different data_dir per env
[platformio]
data_dir = ${PROJECT_DIR}/data-${PIOENV}
Would be helpful if the data_dir documentation could be updated to include this workaround.
As mentioned Different SPIFFS images for different build environments