hermes-client-python 1.8.142__tar.gz → 1.8.143__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: hermes-client-python
3
- Version: 1.8.142
3
+ Version: 1.8.143
4
4
  Summary: Async Python client for Hermes search server
5
5
  Project-URL: Homepage, https://github.com/SpaceFrontiers/hermes
6
6
  Project-URL: Repository, https://github.com/SpaceFrontiers/hermes
@@ -373,7 +373,8 @@ await client.commit("articles") # publishes accepted operations
373
373
  same `DocumentMutationResult`. Single-document helpers raise on rejection. Missing
374
374
  deletion keys are accepted. Commit before deleting/upserting a key with a pending
375
375
  insertion or replacement. Limits are 100,000 deletion keys / 8 MiB key bytes and
376
- 1,000 replacement documents / 32 MiB encoded bytes. Mutations use the usual timeout
376
+ 1,000 replacement documents / 32 MiB encoded bytes, or one replacement / 200 MiB
377
+ including the request envelope. Mutations use the usual timeout
377
378
  argument; an expired RPC may have staged work, so do not blindly retry replacements.
378
379
  Broker commits are atomic within each partition. Physical cleanup remains
379
380
  `await client.force_merge("articles", compact=True)`.
@@ -349,7 +349,8 @@ await client.commit("articles") # publishes accepted operations
349
349
  same `DocumentMutationResult`. Single-document helpers raise on rejection. Missing
350
350
  deletion keys are accepted. Commit before deleting/upserting a key with a pending
351
351
  insertion or replacement. Limits are 100,000 deletion keys / 8 MiB key bytes and
352
- 1,000 replacement documents / 32 MiB encoded bytes. Mutations use the usual timeout
352
+ 1,000 replacement documents / 32 MiB encoded bytes, or one replacement / 200 MiB
353
+ including the request envelope. Mutations use the usual timeout
353
354
  argument; an expired RPC may have staged work, so do not blindly retry replacements.
354
355
  Broker commits are atomic within each partition. Physical cleanup remains
355
356
  `await client.force_merge("articles", compact=True)`.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hermes-client-python"
7
- version = "1.8.142"
7
+ version = "1.8.143"
8
8
  description = "Async Python client for Hermes search server"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -96,7 +96,10 @@ class HermesClient:
96
96
  # Increase message size limits for large responses (e.g., loading content fields)
97
97
  options = [
98
98
  ("grpc.max_receive_message_length", 50 * 1024 * 1024), # 50MB
99
- ("grpc.max_send_message_length", 50 * 1024 * 1024), # 50MB
99
+ (
100
+ "grpc.max_send_message_length",
101
+ 200 * 1024 * 1024,
102
+ ), # singleton upsert ceiling
100
103
  ]
101
104
  # Enable gzip compression for smaller message sizes over the wire
102
105
  self._channel = aio.insecure_channel(
@@ -335,8 +338,8 @@ class HermesClient:
335
338
  """Stage complete replacements, inserting missing keys. No partial patches.
336
339
 
337
340
  Each document must contain its primary key. Inspect per-item errors;
338
- commit publishes accepted operations. At most one pending replacement
339
- per key is allowed, including across calls.
341
+ commit publishes the latest accepted replacement for each key,
342
+ including multiple replacements across calls.
340
343
  """
341
344
  self._ensure_connected()
342
345
  if len(documents) > 1_000:
@@ -347,8 +350,9 @@ class HermesClient:
347
350
  pb.NamedDocument(fields=_to_field_entries(doc)) for doc in documents
348
351
  ],
349
352
  )
350
- if request.ByteSize() > 32 * 1024 * 1024:
351
- raise ValueError("upsert request exceeds 32 MiB encoded bytes")
353
+ limit_mib = 200 if len(documents) == 1 else 32
354
+ if request.ByteSize() > limit_mib * 1024 * 1024:
355
+ raise ValueError(f"upsert request exceeds {limit_mib} MiB encoded bytes")
352
356
  response = await self._index_stub.UpsertDocuments(
353
357
  request, timeout=self._deadline(timeout)
354
358
  )