Skip to content

Commit

Permalink
Fix time example bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Feb 8, 2024
1 parent 3e041ca commit 627416f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/data_common/dataset/resource_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ def rebuild_yaml(self, is_geodata: bool = False):
yaml_str = yaml_str.replace("- no\n", "- 'no'\n")
yaml_str = yaml_str.replace("- yes\n", "- 'yes'\n")

# times get formatted incorrect as numbers, we want to add quotes around them
# e.g. 'example: 21:30' should become 'example: "21:30"'
yaml_str = re.sub(r"example: (\d{2}:\d{2})", r'example: "\1"', yaml_str)

with self.resource_path.open("w") as f:
f.write(yaml_str)
print(f"Updated config for {self.slug} to {self.resource_path}")
Expand Down

0 comments on commit 627416f

Please sign in to comment.