ob-postgres 2.36.0__tar.gz → 3.0.0__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.
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/PKG-INFO +2 -2
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/pyproject.toml +2 -2
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/src/ob_postgres/cursor.py +9 -0
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/tests/test_driver.py +18 -0
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/.gitignore +0 -0
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/AGENTS.md +0 -0
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/CLAUDE.md +0 -0
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/LICENSE +0 -0
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/README.md +0 -0
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/src/ob_postgres/__init__.py +0 -0
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/src/ob_postgres/compiler.py +0 -0
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/src/ob_postgres/connection.py +0 -0
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/src/ob_postgres/exceptions.py +0 -0
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/src/ob_postgres/type_codes.py +0 -0
- {ob_postgres-2.36.0 → ob_postgres-3.0.0}/tests/test_yaml_detection.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: ob-postgres
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0.0
|
|
4
4
|
Summary: OrionBelt Semantic Layer driver for PostgreSQL (DB-API 2.0)
|
|
5
5
|
Author-email: Ralf Becher <info@orionbelt.ai>
|
|
6
6
|
License-Expression: BUSL-1.1
|
|
@@ -8,7 +8,7 @@ License-File: LICENSE
|
|
|
8
8
|
Keywords: db-api,obml,orionbelt,postgres,semantic-layer
|
|
9
9
|
Requires-Python: >=3.12
|
|
10
10
|
Requires-Dist: adbc-driver-postgresql>=1.0
|
|
11
|
-
Requires-Dist: ob-driver-core>=
|
|
11
|
+
Requires-Dist: ob-driver-core>=3.0.0
|
|
12
12
|
Requires-Dist: pyarrow>=16.0
|
|
13
13
|
Provides-Extra: dev
|
|
14
14
|
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ob-postgres"
|
|
7
|
-
version = "
|
|
7
|
+
version = "3.0.0"
|
|
8
8
|
description = "OrionBelt Semantic Layer driver for PostgreSQL (DB-API 2.0)"
|
|
9
9
|
license = "BUSL-1.1"
|
|
10
10
|
license-files = ["LICENSE"]
|
|
@@ -13,7 +13,7 @@ authors = [{ name = "Ralf Becher", email = "info@orionbelt.ai" }]
|
|
|
13
13
|
keywords = ["postgres", "semantic-layer", "obml", "db-api", "orionbelt"]
|
|
14
14
|
requires-python = ">=3.12"
|
|
15
15
|
dependencies = [
|
|
16
|
-
"ob-driver-core>=
|
|
16
|
+
"ob-driver-core>=3.0.0",
|
|
17
17
|
"adbc-driver-postgresql>=1.0",
|
|
18
18
|
"pyarrow>=16.0",
|
|
19
19
|
]
|
|
@@ -138,6 +138,15 @@ class Cursor:
|
|
|
138
138
|
self._check_open()
|
|
139
139
|
return self._native.fetch_arrow_table()
|
|
140
140
|
|
|
141
|
+
def fetch_record_batch(self) -> Any:
|
|
142
|
+
"""Stream the remaining rows as a ``pyarrow.RecordBatchReader`` (ADBC native).
|
|
143
|
+
|
|
144
|
+
The rows arrive batch by batch rather than as one table, so a caller
|
|
145
|
+
can write a large result to disk without holding all of it in memory.
|
|
146
|
+
"""
|
|
147
|
+
self._check_open()
|
|
148
|
+
return self._native.fetch_record_batch()
|
|
149
|
+
|
|
141
150
|
def close(self) -> None:
|
|
142
151
|
"""Close the cursor."""
|
|
143
152
|
if not self._closed:
|
|
@@ -420,3 +420,21 @@ def test_plain_sql_passthrough() -> None:
|
|
|
420
420
|
cur.execute("SELECT COUNT(*) FROM orders")
|
|
421
421
|
mock_post.assert_not_called()
|
|
422
422
|
mock_native.cursor().execute.assert_called_once_with("SELECT COUNT(*) FROM orders")
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
def test_cursor_streams_the_native_record_batch_reader() -> None:
|
|
426
|
+
"""A large result can be read batch by batch, not only as one table."""
|
|
427
|
+
mock_native = _make_mock_native()
|
|
428
|
+
reader = object()
|
|
429
|
+
mock_native.cursor().fetch_record_batch.return_value = reader
|
|
430
|
+
cur = Connection(mock_native).cursor()
|
|
431
|
+
|
|
432
|
+
assert cur.fetch_record_batch() is reader
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
def test_streaming_a_closed_cursor_is_refused() -> None:
|
|
436
|
+
cur = Connection(_make_mock_native()).cursor()
|
|
437
|
+
cur.close()
|
|
438
|
+
|
|
439
|
+
with pytest.raises(ProgrammingError):
|
|
440
|
+
cur.fetch_record_batch()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|