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
4 changes: 2 additions & 2 deletions contracts/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4393,7 +4393,7 @@
"type": "object"
},
"GraphImportPublishedGenerationOutcome": {
"description": "Durable publication accepted after `POST /v1/graph/import?publish=true`.\nThe import request never constructs index families or waits for publication;\nclients can poll the returned job while continuing to observe the previously\npublished generation.",
"description": "Durable publication accepted after `POST /v1/graph/import`.\nThe import request never constructs index families or waits for publication;\nclients can poll the returned job while continuing to observe the previously\npublished generation.",
"properties": {
"disposition": {
"$ref": "#/components/schemas/PublishedGenerationEnqueueDisposition"
Expand All @@ -4417,7 +4417,7 @@
"type": "object"
},
"GraphImportResponse": {
"description": "Aggregate outcome of a bulk NDJSON import. `committed_commit_seq` is the\nsequence of the last internal batch commit (absent if nothing committed).\n`errors` is bounded; `error_count` is the true total even when the list is\ntruncated. `published_generation` is present only when the caller passed\n`?publish=true` and at least one batch committed.",
"description": "Aggregate outcome of a bulk NDJSON import. `committed_commit_seq` is the\nsequence of the last internal batch commit (absent if nothing committed).\n`errors` is bounded; `error_count` is the true total even when the list is\ntruncated. `published_generation` is present when at least one batch\ncommitted; publication is automatic.",
"properties": {
"batches": {
"minimum": 0,
Expand Down
16 changes: 4 additions & 12 deletions lbb/_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,6 @@ def import_ndjson(
batch: int | None = None,
strict: bool | None = None,
observed_at: str | None = None,
publish: bool | None = None,
idempotency_key: str | None = None,
) -> Any:
"""Bulk-ingest a dataset as NDJSON.
Expand All @@ -879,10 +878,10 @@ def import_ndjson(
batched into bounded internal commits server-side, so a whole dataset loads
in one streamed request without a single oversized commit.

Set ``publish=True`` to durably enqueue one complete
published-generation build after the final batch. The import does not
wait for visibility; ``published_generation`` carries the durable job
identity and due sequence to observe.
A successful import durably enqueues one complete published-generation
build after the final batch. It does not wait for visibility;
``published_generation`` carries the durable job identity and due
sequence to observe.
"""
ndjson = (
lines
Expand All @@ -896,7 +895,6 @@ def import_ndjson(
"batch": batch,
"strict": strict,
"observed_at": observed_at,
"publish": publish,
},
content=ndjson,
content_type="application/x-ndjson",
Expand Down Expand Up @@ -964,7 +962,6 @@ def import_rdf(
observed_at: str | None = None,
resource_type: str | None = None,
edge_idempotency: str | None = None,
publish: bool | None = None,
idempotency_key: str | None = None,
) -> Any:
"""Bulk-ingest N-Triples, Turtle, N-Quads, or TriG through the native RDF import endpoint.
Expand Down Expand Up @@ -994,7 +991,6 @@ def import_rdf(
"blank_node_scope": blank_node_scope,
"resource_type": resource_type,
"edge_idempotency": edge_idempotency,
"publish": publish,
},
content=rdf,
content_type=content_types[format],
Expand Down Expand Up @@ -1858,7 +1854,6 @@ def import_ndjson(
batch: int | None = None,
strict: bool | None = None,
observed_at: str | None = None,
publish: bool | None = None,
idempotency_key: str | None = None,
) -> Any:
"""Bulk-load a dataset as NDJSON. See :meth:`LbbClient.import_ndjson`."""
Expand All @@ -1876,7 +1871,6 @@ def import_ndjson(
"batch": batch,
"strict": strict,
"observed_at": observed_at,
"publish": publish,
},
content=ndjson,
content_type="application/x-ndjson",
Expand All @@ -1896,7 +1890,6 @@ def import_rdf(
observed_at: str | None = None,
resource_type: str | None = None,
edge_idempotency: str | None = None,
publish: bool | None = None,
idempotency_key: str | None = None,
) -> Any:
"""Bulk-load N-Triples, Turtle, N-Quads, or TriG. See :meth:`LbbClient.import_rdf`."""
Expand All @@ -1923,7 +1916,6 @@ def import_rdf(
"blank_node_scope": blank_node_scope,
"resource_type": resource_type,
"edge_idempotency": edge_idempotency,
"publish": publish,
},
content=rdf,
content_type=content_types[format],
Expand Down
6 changes: 3 additions & 3 deletions lbb/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4505,7 +4505,7 @@ class GraphEdgeRow(BaseModel):

class GraphImportPublishedGenerationOutcome(BaseModel):
"""
Durable publication accepted after `POST /v1/graph/import?publish=true`.
Durable publication accepted after `POST /v1/graph/import`.
The import request never constructs index families or waits for publication;
clients can poll the returned job while continuing to observe the previously
published generation.
Expand All @@ -4522,8 +4522,8 @@ class GraphImportResponse(BaseModel):
Aggregate outcome of a bulk NDJSON import. `committed_commit_seq` is the
sequence of the last internal batch commit (absent if nothing committed).
`errors` is bounded; `error_count` is the true total even when the list is
truncated. `published_generation` is present only when the caller passed
`?publish=true` and at least one batch committed.
truncated. `published_generation` is present when at least one batch
committed; publication is automatic.
"""

batches: Annotated[int, Field(ge=0)]
Expand Down
4 changes: 0 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,15 +1059,13 @@ def test_facts_import_serializes_ndjson_with_params(self) -> None:
],
batch=500,
strict=True,
publish=True,
)
self.assertEqual(result["triplets"], 1)
request = seen[0]
self.assertEqual(str(request.url).split("?")[0], "http://h/v1/graph/import")
self.assertEqual(dict(request.url.params)["graph"], "research")
self.assertEqual(dict(request.url.params)["batch"], "500")
self.assertEqual(dict(request.url.params)["strict"], "true")
self.assertEqual(dict(request.url.params)["publish"], "true")
self.assertEqual(request.headers["content-type"], "application/x-ndjson")
self.assertRegex(request.headers["idempotency-key"], r"^import:")
lines = request.content.decode().split("\n")
Expand All @@ -1089,7 +1087,6 @@ def test_facts_import_rdf_posts_ntriples_with_params(self) -> None:
blank_node_scope="document-42",
resource_type="RdfResource",
edge_idempotency="append",
publish=True,
)
self.assertEqual(result["imported_triplets"], 1)
request = seen[0]
Expand All @@ -1102,7 +1099,6 @@ def test_facts_import_rdf_posts_ntriples_with_params(self) -> None:
self.assertEqual(params["blank_node_scope"], "document-42")
self.assertEqual(params["resource_type"], "RdfResource")
self.assertEqual(params["edge_idempotency"], "append")
self.assertEqual(params["publish"], "true")
self.assertEqual(request.headers["content-type"], "application/n-triples")
self.assertRegex(request.headers["idempotency-key"], r"^import-rdf:")
self.assertEqual(request.content.decode(), body)
Expand Down
Loading