Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def _customize_store(self, store: DocumentStore) -> None:
)

def __test_when_collection_and_id_contain_special_chars(self, c: str) -> None:
if 14 <= ord(c) <= 31:
# RavenDB now rejects control characters in document ids (including the generated HiLo id),
# so skip the whole C0 control range rather than only 14..31.
if ord(c) <= 31:
return

self.c = c
Expand Down
6 changes: 5 additions & 1 deletion ravendb/tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from collections import Iterable, Sequence

from ravendb.tools.projection import create_entity_with_mapper
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
from enum import Enum
from threading import Timer
from copy import deepcopy
Expand Down Expand Up @@ -958,4 +958,8 @@ def add_minutes(date: datetime, minutes: int):

@staticmethod
def get_unix_time_in_ms(date: datetime) -> int:
# Naive datetimes are treated as UTC (consistent with Utils.datetime_to_string) so that
# bulk-insert time-series timestamps are not shifted by the machine's local UTC offset.
if date.tzinfo is None:
date = date.replace(tzinfo=timezone.utc)
return int(date.timestamp() * 1000)
Loading