Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/bokeh/util/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
#-----------------------------------------------------------------------------
from __future__ import annotations

from bokeh.core.types import ID as _ID

import logging # isort:skip

log = logging.getLogger(__name__)

#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -279,9 +282,7 @@ def make_globally_unique_id() -> ID:
str

'''
from ..core.types import ID

return ID(str(uuid.uuid4()))
return _ID(str(uuid.uuid4()))

def make_globally_unique_css_safe_id() -> ID:
''' Return a globally unique CSS-safe UUID.
Expand All @@ -294,16 +295,14 @@ def make_globally_unique_css_safe_id() -> ID:
str

'''
from ..core.types import ID

max_iter = 100

for _i in range(0, max_iter):
id = make_globally_unique_id()
id = str(uuid.uuid4())
if id[0].isalpha():
return id
return _ID(id)

return ID(f"bk-{make_globally_unique_id()}")
return _ID(f"bk-{make_globally_unique_id()}")

def array_encoding_disabled(array: npt.NDArray[Any]) -> bool:
''' Determine whether an array may be binary encoded.
Expand Down