Skip to content

Commit 4894faa

Browse files
authored
Merge pull request #262 from poissoncorp/RDBC-999
RDBC-999 VectorQuantizer should return list[int] instead of bytes for proper serialization RDBC-991 Add 7.2 to GHA RavenDB version matrix (python) Fixed failing tests Fixed 3.14 issue with "unhashable" error message
2 parents 7e83006 + e6c05e8 commit 4894faa

28 files changed

Lines changed: 308 additions & 76 deletions

.github/workflows/RavenClient.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ jobs:
2525
RAVENDB_PYTHON_TEST_SERVER_CERTIFICATE_PATH: certs/server.pfx
2626
RAVENDB_PYTHON_TEST_CLIENT_CERTIFICATE_PATH: certs/python.pem
2727
RAVENDB_PYTHON_TEST_CA_PATH: /usr/local/share/ca-certificates/ca.crt
28-
RAVENDB_PYTHON_TEST_HTTPS_SERVER_URL: https://localhost:7326
28+
RAVENDB_PYTHON_TEST_HTTPS_SERVER_URL: https://localhost:8081
2929

3030
strategy:
3131
matrix:
32-
python-version: [ '3.9', '3.10' ,'3.11', '3.12']
33-
serverVersion: [ '7.1' ]
32+
python-version: [ '3.10' ,'3.11', '3.12', '3.13', '3.14']
33+
serverVersion: [ '7.1', '7.2' ]
3434
fail-fast: false
3535

3636
steps:
@@ -54,7 +54,7 @@ jobs:
5454
5555
- run: mkdir certs
5656
- run: openssl genrsa -out certs/ca.key 2048
57-
- run: openssl req -new -x509 -key certs/ca.key -out certs/ca.crt -subj "/C=US/ST=Arizona/L=Nevada/O=RavenDB Test CA/OU=RavenDB test CA/CN=localhost/emailAddress=ravendbca@example.com" -addext "basicConstraints = CA:TRUE" -addext "keyUsage = digitalSignature,keyCertSign"
57+
- run: openssl req -new -x509 -key certs/ca.key -out certs/ca.crt -subj "/C=US/ST=Arizona/L=Nevada/O=RavenDB Test CA/OU=RavenDB test CA/CN=localhost/emailAddress=ravendbca@example.com" -addext "basicConstraints = critical, CA:TRUE" -addext "keyUsage = critical, digitalSignature, keyCertSign"
5858
- run: openssl genrsa -out certs/localhost.key 2048
5959
- run: openssl req -new -key certs/localhost.key -out certs/localhost.csr -subj "/C=US/ST=Arizona/L=Nevada/O=RavenDB Test/OU=RavenDB test/CN=localhost/emailAddress=ravendb@example.com" -addext "subjectAltName = DNS:localhost"
6060
- run: openssl x509 -req -extensions ext -extfile cert/test_cert.conf -in certs/localhost.csr -CA certs/ca.crt -CAkey certs/ca.key -CAcreateserial -out certs/localhost.crt
@@ -85,11 +85,9 @@ jobs:
8585
run: mkdir RavenDB/Server/certs && cp certs/server.pfx RavenDB/Server/certs/
8686

8787
- name: Install black linter
88-
if: ${{ matrix.python-version != '3.7' }}
8988
run: pip install black
9089

9190
- name: Check code format
92-
if: ${{ matrix.python-version != '3.7' }}
9391
run: black --check .
9492

9593
- name: Run tests

ravendb/documents/conventions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def __init__(self):
8787
self.wait_for_indexes_after_save_changes_timeout = timedelta(seconds=15)
8888
self.wait_for_replication_after_save_changes_timeout = timedelta(seconds=15)
8989
self.wait_for_non_stale_results_timeout = timedelta(seconds=15)
90+
self.max_empty_lines_in_jsonl_stream = 100
9091

9192
# Balancing
9293
self._load_balancer_context_seed: Optional[int] = None

ravendb/documents/indexes/time_series.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from ravendb.documents.indexes.spatial.configuration import SpatialOptions, SpatialOptionsFactory
2222
from ravendb.primitives import constants
2323

24-
2524
_T_IndexDefinition = TypeVar("_T_IndexDefinition", bound=IndexDefinition)
2625

2726

ravendb/documents/operations/ai/abstract_ai_settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44

55
class AbstractAiSettings(ABC):
6-
def __init__(self):
7-
self.embeddings_max_concurrent_batches = None
6+
def __init__(self, embeddings_max_concurrent_batches: int = None):
7+
self.embeddings_max_concurrent_batches = embeddings_max_concurrent_batches
88

99
@classmethod
1010
@abstractmethod

ravendb/documents/operations/ai/agents/add_or_update_ai_agent_operation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from ravendb.http.server_node import ServerNode
1010
import requests
1111

12-
1312
if TYPE_CHECKING:
1413
from ravendb.documents.operations.ai.agents.ai_agent_configuration import AiAgentConfiguration
1514

ravendb/documents/operations/ai/agents/run_conversation_operation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from ravendb.http.misc import ResponseDisposeHandling
1212
from ravendb.documents.ai.content_part import ContentPart
1313

14-
1514
TSchema = TypeVar("TSchema")
1615

1716

ravendb/documents/operations/ai/azure_open_ai_settings.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ def __init__(
1212
deployment_name: str = None,
1313
dimensions: int = None,
1414
temperature: float = None,
15+
embeddings_max_concurrent_batches: int = None,
1516
):
16-
super().__init__(api_key, endpoint, model, dimensions, temperature)
17+
super().__init__(api_key, endpoint, model, dimensions, temperature, embeddings_max_concurrent_batches)
1718
if deployment_name is None:
1819
raise ValueError("deployment_name cannot be None")
1920
self.deployment_name = deployment_name
@@ -27,6 +28,9 @@ def from_json(cls, json_dict: Dict[str, Any]) -> "AzureOpenAiSettings":
2728
dimensions=json_dict["Dimensions"] if "Dimensions" in json_dict else None,
2829
temperature=json_dict["Temperature"] if "Temperature" in json_dict else None,
2930
deployment_name=json_dict["DeploymentName"] if "DeploymentName" in json_dict else None,
31+
embeddings_max_concurrent_batches=(
32+
json_dict["EmbeddingsMaxConcurrentBatches"] if "EmbeddingsMaxConcurrentBatches" in json_dict else None
33+
),
3034
)
3135

3236
def to_json(self) -> Dict[str, Any]:
@@ -37,4 +41,5 @@ def to_json(self) -> Dict[str, Any]:
3741
"Dimensions": self.dimensions,
3842
"Temperature": self.temperature,
3943
"DeploymentName": self.deployment_name,
44+
"EmbeddingsMaxConcurrentBatches": self.embeddings_max_concurrent_batches,
4045
}

ravendb/documents/operations/ai/embedded_settings.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@
44

55

66
class EmbeddedSettings(AbstractAiSettings):
7-
def __init__(self):
8-
super().__init__()
7+
def __init__(self, embeddings_max_concurrent_batches: int = None):
8+
super().__init__(embeddings_max_concurrent_batches)
99

1010
@classmethod
1111
def from_json(cls, json_dict: Dict[str, Any]) -> "EmbeddedSettings":
12-
return cls()
12+
return cls(
13+
embeddings_max_concurrent_batches=(
14+
json_dict.get("EmbeddingsMaxConcurrentBatches")
15+
if json_dict.get("EmbeddingsMaxConcurrentBatches")
16+
else None
17+
),
18+
)
1319

1420
def to_json(self) -> Dict[str, Any]:
1521
return {"EmbeddingsMaxConcurrentBatches": self.embeddings_max_concurrent_batches}

ravendb/documents/operations/ai/google_settings.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ class GoogleAiVersion(Enum):
1111

1212
class GoogleSettings(AbstractAiSettings):
1313
def __init__(
14-
self, model: str = None, api_key: str = None, ai_version: GoogleAiVersion = None, dimensions: int = None
14+
self,
15+
model: str = None,
16+
api_key: str = None,
17+
ai_version: GoogleAiVersion = None,
18+
dimensions: int = None,
19+
embeddings_max_concurrent_batches: int = None,
1520
):
16-
super().__init__()
21+
super().__init__(embeddings_max_concurrent_batches)
1722
self.model = model
1823
self.api_key = api_key
1924
self.ai_version = ai_version
@@ -22,10 +27,13 @@ def __init__(
2227
@classmethod
2328
def from_json(cls, json_dict: Dict[str, Any]) -> "GoogleSettings":
2429
return cls(
25-
model=json_dict["Model"],
26-
api_key=json_dict["ApiKey"],
27-
ai_version=GoogleAiVersion(json_dict["AiVersion"]),
28-
dimensions=json_dict["Dimensions"],
30+
model=json_dict["Model"] if "Model" in json_dict else None,
31+
api_key=json_dict["ApiKey"] if "ApiKey" in json_dict else None,
32+
ai_version=GoogleAiVersion(json_dict["AiVersion"]) if "AiVersion" in json_dict else None,
33+
dimensions=json_dict["Dimensions"] if "Dimensions" in json_dict else None,
34+
embeddings_max_concurrent_batches=(
35+
json_dict["EmbeddingsMaxConcurrentBatches"] if "EmbeddingsMaxConcurrentBatches" in json_dict else None
36+
),
2937
)
3038

3139
def to_json(self) -> Dict[str, Any]:

ravendb/documents/operations/ai/hugging_face_settings.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,27 @@
44

55

66
class HuggingFaceSettings(AbstractAiSettings):
7-
def __init__(self, api_key: str = None, model: str = None, endpoint: str = None):
8-
super().__init__()
7+
def __init__(
8+
self,
9+
api_key: str = None,
10+
model: str = None,
11+
endpoint: str = None,
12+
embeddings_max_concurrent_batches: int = None,
13+
):
14+
super().__init__(embeddings_max_concurrent_batches)
915
self.api_key = api_key
1016
self.model = model
1117
self.endpoint = endpoint
1218

1319
@classmethod
1420
def from_json(cls, json_dict: Dict[str, Any]) -> "HuggingFaceSettings":
1521
return cls(
16-
api_key=json_dict["ApiKey"],
17-
model=json_dict["Model"],
18-
endpoint=json_dict["Endpoint"],
22+
api_key=json_dict["ApiKey"] if "ApiKey" in json_dict else None,
23+
model=json_dict["Model"] if "Model" in json_dict else None,
24+
endpoint=json_dict["Endpoint"] if "Endpoint" in json_dict else None,
25+
embeddings_max_concurrent_batches=(
26+
json_dict["EmbeddingsMaxConcurrentBatches"] if "EmbeddingsMaxConcurrentBatches" in json_dict else None
27+
),
1928
)
2029

2130
def to_json(self) -> Dict[str, Any]:

0 commit comments

Comments
 (0)