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

Sorry for cherry pick.