Skip to content

Commit

Permalink
fix data generation pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Jan 16, 2025
1 parent 4d2ce93 commit fafd719
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion data/processors/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ def unlocalise(value: str | list[Any] | dict[str, Any]) -> Any:
raise ValueError(f"Unhandled type {type(value)}")


def normalise_id(_id: str) -> str:
def normalise_id(_id: str) -> str | None:
"""Remove leading zeros from all point-separated parts of input string"""
if not _id:
return None

parts = [part.lstrip("0") or "0" for part in _id.split(".")]
return ".".join(parts)

Expand Down

0 comments on commit fafd719

Please sign in to comment.