Skip to content

Commit 7ddce19

Browse files
chore: revert cuid2 upgrade
Aligns with frontend and provides time-sortable IDs.
1 parent 70c21a2 commit 7ddce19

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies = [
3838
"typing-extensions >= 4.5.0, < 5.0.0",
3939
"pyparsing >= 3.0.0, < 4.0.0",
4040
"websocket-client >= 1.0.0, < 2.0.0",
41-
"cuid2 >= 2.0.0, < 3.0.0",
41+
"cuid >= 0.4, < 0.5",
4242
"urllib3 >= 1.26, < 3",
4343
"gql[requests,websockets] >= 3.5.0b5, < 4.0.0",
4444
"filelock >= 3.0.0, < 4.0.0",

src/kili/use_cases/label/process_shapefiles.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
import struct
99
from typing import TYPE_CHECKING, Optional, Union, cast
1010

11-
from cuid2 import cuid_wrapper
12-
13-
cuid = cuid_wrapper()
11+
from cuid import cuid
1412

1513
if TYPE_CHECKING:
1614
from shapely.geometry import LinearRing, LineString, Point, Polygon

src/kili/utils/bucket.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Union
66
from urllib.parse import parse_qs, urlparse
77

8-
from cuid2 import cuid_wrapper
8+
import cuid
99
from tenacity import retry
1010
from tenacity.stop import stop_after_attempt
1111
from tenacity.wait import wait_random
@@ -14,12 +14,10 @@
1414

1515
MAX_NUMBER_SIGNED_URLS_TO_FETCH = 30
1616

17-
_cuid_generator = cuid_wrapper()
18-
1917

2018
def generate_unique_id() -> str:
2119
"""Generate a unique id."""
22-
return _cuid_generator()
20+
return cuid.cuid()
2321

2422

2523
# pylint: disable=missing-type-doc

0 commit comments

Comments
 (0)