UUIDs

Overview

This page outlines our guidelines for handling UUIDs in task scripts.

Guidelines

Note: this function generates UUIDv7 values, which are lexicographically sortable and time-based, but not deterministic. UUIDs generated this way are unique across different files and across different task scripts, so there are no primary key clashes when aggregating multiple IDS documents or querying them with SQL. Because the values are not deterministic, reprocessing the same file produces new UUIDs; the primary and foreign keys within one IDS document are generated together and stay consistent with each other. The mock_uuid_generator fixture from ts-lib-pytest can be used to make the output deterministic in tests.