Skip to content

Commit

Permalink
Feat: Replace ULID raw record ID with UUID v7 (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers authored Jul 18, 2024
1 parent 4249bd4 commit 0616d8a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions airbyte/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
from typing import TYPE_CHECKING, Any

import pytz
import ulid
from uuid_extensions import uuid7str

from airbyte._util.name_normalizers import LowerCaseNormalizer, NameNormalizerBase
from airbyte.constants import (
Expand Down Expand Up @@ -142,7 +142,7 @@ def from_record_message(
) -> StreamRecord:
"""Return a StreamRecord from a RecordMessage."""
data_dict: dict[str, Any] = record_message.data.copy()
data_dict[AB_RAW_ID_COLUMN] = str(ulid.ULID())
data_dict[AB_RAW_ID_COLUMN] = uuid7str()
data_dict[AB_EXTRACTED_AT_COLUMN] = datetime.fromtimestamp(
record_message.emitted_at / 1000, tz=pytz.utc
)
Expand Down
29 changes: 15 additions & 14 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ snowflake-connector-python = "^3.10.0"
snowflake-sqlalchemy = "^1.5.1"
sqlalchemy = "1.4.51"
types-pyyaml = "^6.0.12.12"
ulid = "^1.1"

# TODO: Remove this arbitrary python constraint once `sqlalchemy-bigquery` has done so.
sqlalchemy-bigquery = { version = "1.9.0", python = "<3.13" }
airbyte-api = "^0.49.2"
google-cloud-bigquery-storage = "^2.25.0"
uuid7 = "^0.1.0"

[tool.poetry.group.dev.dependencies]
docker = "^7.0.0"
Expand Down

0 comments on commit 0616d8a

Please sign in to comment.