GDASCRIPTS [Cherry pick from master] Fix failing test caused buy fixing a bug in metadata.py

Sorry for the cherry pick all!