polygres-sdk 0.3.0__tar.gz → 0.4.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.
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/CONTRIBUTING.md +4 -4
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/PKG-INFO +58 -4
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/README.md +57 -3
- polygres_sdk-0.4.0/compatibility/0.3.0/README.md +10 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/docs/reference-v1.md +487 -1
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/migrations/README.md +4 -0
- polygres_sdk-0.4.0/migrations/pgcontext-0.2.0-names.md +71 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/pyproject.toml +1 -1
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_method_metadata.py +2 -2
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/auth/enums.py +18 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/auth/principals.py +2 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/context/models.py +747 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/errors/generated.py +369 -2
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/client.py +39 -7
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/context.py +1442 -38
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/context_validation.py +12 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/errors.py +17 -0
- polygres_sdk-0.4.0/src/polygres/spec/pgcontext-0.2.0-compatibility.json +1960 -0
- polygres_sdk-0.4.0/src/polygres/spec/python-sdk-v1.methods.json +8083 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/spec/python-sdk-v1.methods.schema.json +20 -3
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/spec/runtime-v1.openapi.json +10176 -3793
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tests/fixtures/context/contract-fixtures.json +312 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tests/test_client.py +191 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tests/test_context.py +437 -2
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tests/test_method_spec.py +5 -3
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tests/test_release_workflow.py +10 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tests/test_version.py +6 -6
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tests/test_version_notices.py +9 -9
- polygres_sdk-0.4.0/tools/check_pgcontext_compatibility.py +166 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tools/generate_runtime_openapi_snapshot.py +0 -1
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tools/generate_sdk_method_spec.py +2 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tools/runtime_operation_exclusions.json +12 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tools/verify_distribution.py +2 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/.gitignore +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/LICENSE +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/compatibility/0.1.0/README.md +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/compatibility/0.1.0/python-sdk-v1.methods.json +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/compatibility/0.2.1/README.md +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/compatibility/0.2.1/python-sdk-v1.methods.json +0 -0
- {polygres_sdk-0.3.0/src/polygres/spec → polygres_sdk-0.4.0/compatibility/0.3.0}/python-sdk-v1.methods.json +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/migrations/vector-configuration-creation.md +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/__init__.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_api_version.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/__init__.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/__init__.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/api_versions.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/auth/__init__.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/auth/api_keys.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/auth/errors.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/auth/models.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/auth/ports.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/auth/records.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/auth/types.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/context/__init__.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/context/enums.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/context/errors.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/context/validation.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/core/__init__.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/core/models.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/core/types.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/errors/__init__.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_vendor/polygres_lib/errors/catalog.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/_version.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/context_models.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/context_wait.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/models.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/py.typed +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/rows.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/spec/__init__.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/src/polygres/version_notices.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tests/conftest.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tests/test_compatibility.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tests/test_packaged_resources.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tests/test_rows.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tools/check_sdk_compatibility.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tools/extract_release_notes.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tools/run_context_live_test.sh +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tools/test_context_live.py +0 -0
- {polygres_sdk-0.3.0 → polygres_sdk-0.4.0}/tools/verify_release_version.py +0 -0
|
@@ -23,7 +23,7 @@ python tools/generate_runtime_openapi_snapshot.py --check
|
|
|
23
23
|
python tools/generate_sdk_method_spec.py --check
|
|
24
24
|
python tools/generate_sdk_method_spec.py --validate-only
|
|
25
25
|
python tools/check_sdk_compatibility.py \
|
|
26
|
-
--baseline compatibility/0.
|
|
26
|
+
--baseline compatibility/0.3.0/python-sdk-v1.methods.json
|
|
27
27
|
python -m build
|
|
28
28
|
python tools/verify_distribution.py dist/*.whl dist/*.tar.gz
|
|
29
29
|
```
|
|
@@ -60,7 +60,7 @@ Release rehearsal happens first on TestPyPI:
|
|
|
60
60
|
/tmp/polygres-sdk-testpypi/bin/python -m pip install \
|
|
61
61
|
--index-url https://test.pypi.org/simple/ \
|
|
62
62
|
--extra-index-url https://pypi.org/simple/ \
|
|
63
|
-
polygres-sdk==0.
|
|
63
|
+
polygres-sdk==0.4.0
|
|
64
64
|
/tmp/polygres-sdk-testpypi/bin/python - <<'PY'
|
|
65
65
|
import importlib.metadata
|
|
66
66
|
from polygres import Polygres
|
|
@@ -74,8 +74,8 @@ Publish to PyPI only after the same commit has passed TestPyPI validation. Push
|
|
|
74
74
|
a release tag from the public repository:
|
|
75
75
|
|
|
76
76
|
```bash
|
|
77
|
-
git tag polygres-sdk-v0.
|
|
78
|
-
git push origin polygres-sdk-v0.
|
|
77
|
+
git tag polygres-sdk-v0.4.0
|
|
78
|
+
git push origin polygres-sdk-v0.4.0
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
The `pypi` GitHub environment must be approved before the upload proceeds.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: polygres-sdk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Python SDK for Polygres
|
|
5
5
|
Project-URL: Homepage, https://polygres.com
|
|
6
6
|
Project-URL: Documentation, https://docs.polygres.com/sdk
|
|
@@ -81,6 +81,23 @@ print(readiness.graph, readiness.vector, readiness.hybrid)
|
|
|
81
81
|
|
|
82
82
|
Use the Runtime API URL with the SDK. Do not use a direct or pooled PostgreSQL connection string.
|
|
83
83
|
|
|
84
|
+
## Synchronized PostgreSQL projects
|
|
85
|
+
|
|
86
|
+
For a synchronized project, the Runtime does not expose connection information.
|
|
87
|
+
That surface raises `PolygresPermissionError` with code
|
|
88
|
+
`SYNCED_PROJECT_SURFACE_UNAVAILABLE`. Readiness, `project.vector`,
|
|
89
|
+
`project.hybrid`, graph, text-search, and pgContext remain available after
|
|
90
|
+
synchronization is ready.
|
|
91
|
+
|
|
92
|
+
If your application already has the authoritative control-plane project payload,
|
|
93
|
+
pass its mode to the SDK to reject a connection-information call before building
|
|
94
|
+
a Runtime request. The Runtime enforces the same boundary when no mode hint is
|
|
95
|
+
supplied.
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
project = client.project(project_mode="synced")
|
|
99
|
+
```
|
|
100
|
+
|
|
84
101
|
## Choose a retrieval method
|
|
85
102
|
|
|
86
103
|
| Need | Method |
|
|
@@ -97,6 +114,41 @@ New vector setup uses `project.context.create_collection()` with a native
|
|
|
97
114
|
`pgcontext.vector` column. Existing `project.vector` retrieval methods remain available
|
|
98
115
|
for applications using previously registered vector configurations.
|
|
99
116
|
|
|
117
|
+
## pgContext-aligned names
|
|
118
|
+
|
|
119
|
+
SDK 0.4.0 adds pgContext 0.2.0 terminology while keeping every SDK 0.3.0
|
|
120
|
+
Context method available. Existing applications can upgrade without changing
|
|
121
|
+
their calls.
|
|
122
|
+
|
|
123
|
+
The stable pgContext 0.2.0 inventory is fully classified and has no missing SDK
|
|
124
|
+
entries. Database-native vector operators remain SQL-only, and five
|
|
125
|
+
backend-wide or privileged instrumentation functions remain available through
|
|
126
|
+
direct SQL rather than the project-scoped Runtime API. See the
|
|
127
|
+
[migration and coverage notes](migrations/pgcontext-0.2.0-names.md).
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
operation = project.context.register_vector(
|
|
131
|
+
collection_id,
|
|
132
|
+
"title_embedding",
|
|
133
|
+
768,
|
|
134
|
+
)
|
|
135
|
+
project.context.register_filter_column(
|
|
136
|
+
collection_id,
|
|
137
|
+
"tenant_id",
|
|
138
|
+
"tenant_id",
|
|
139
|
+
)
|
|
140
|
+
results = project.context.query(
|
|
141
|
+
"support_docs",
|
|
142
|
+
query_embedding,
|
|
143
|
+
query="refund policy",
|
|
144
|
+
)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The earlier `add_vector()`, `add_filter_column()`, and `text_hybrid()` names
|
|
148
|
+
remain silent compatibility aliases with unchanged behavior. See the
|
|
149
|
+
[pgContext naming migration](migrations/pgcontext-0.2.0-names.md) for the full
|
|
150
|
+
mapping.
|
|
151
|
+
|
|
100
152
|
## Vector retrieval
|
|
101
153
|
|
|
102
154
|
Generate the query embedding with the same model and dimensions used by the saved vector configuration.
|
|
@@ -274,7 +326,9 @@ Keep the request ID when reporting a problem. Never log or send the Project API
|
|
|
274
326
|
|
|
275
327
|
## Connection information
|
|
276
328
|
|
|
277
|
-
`connection_info()` returns project hosts and passwordless
|
|
329
|
+
For a standard project, `connection_info()` returns project hosts and passwordless
|
|
330
|
+
connection strings. It never returns the database password. It raises
|
|
331
|
+
`PolygresPermissionError` for a synchronized project.
|
|
278
332
|
|
|
279
333
|
```python
|
|
280
334
|
connection = project.connection_info()
|
|
@@ -311,11 +365,11 @@ payload and idempotency key.
|
|
|
311
365
|
|
|
312
366
|
## Version and support
|
|
313
367
|
|
|
314
|
-
Package version: [`0.
|
|
368
|
+
Package version: [`0.4.0`](https://github.com/Evokoa/polygres-sdk/releases/tag/polygres-sdk-v0.4.0).
|
|
315
369
|
|
|
316
370
|
When contacting support, include the installed SDK version and the request ID.
|
|
317
371
|
|
|
318
|
-
See the [SDK 0.
|
|
372
|
+
See the [SDK 0.4.0 release notes](https://github.com/Evokoa/polygres-sdk/releases/tag/polygres-sdk-v0.4.0) for release changes.
|
|
319
373
|
|
|
320
374
|
## Optional Agent Skill
|
|
321
375
|
|
|
@@ -39,6 +39,23 @@ print(readiness.graph, readiness.vector, readiness.hybrid)
|
|
|
39
39
|
|
|
40
40
|
Use the Runtime API URL with the SDK. Do not use a direct or pooled PostgreSQL connection string.
|
|
41
41
|
|
|
42
|
+
## Synchronized PostgreSQL projects
|
|
43
|
+
|
|
44
|
+
For a synchronized project, the Runtime does not expose connection information.
|
|
45
|
+
That surface raises `PolygresPermissionError` with code
|
|
46
|
+
`SYNCED_PROJECT_SURFACE_UNAVAILABLE`. Readiness, `project.vector`,
|
|
47
|
+
`project.hybrid`, graph, text-search, and pgContext remain available after
|
|
48
|
+
synchronization is ready.
|
|
49
|
+
|
|
50
|
+
If your application already has the authoritative control-plane project payload,
|
|
51
|
+
pass its mode to the SDK to reject a connection-information call before building
|
|
52
|
+
a Runtime request. The Runtime enforces the same boundary when no mode hint is
|
|
53
|
+
supplied.
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
project = client.project(project_mode="synced")
|
|
57
|
+
```
|
|
58
|
+
|
|
42
59
|
## Choose a retrieval method
|
|
43
60
|
|
|
44
61
|
| Need | Method |
|
|
@@ -55,6 +72,41 @@ New vector setup uses `project.context.create_collection()` with a native
|
|
|
55
72
|
`pgcontext.vector` column. Existing `project.vector` retrieval methods remain available
|
|
56
73
|
for applications using previously registered vector configurations.
|
|
57
74
|
|
|
75
|
+
## pgContext-aligned names
|
|
76
|
+
|
|
77
|
+
SDK 0.4.0 adds pgContext 0.2.0 terminology while keeping every SDK 0.3.0
|
|
78
|
+
Context method available. Existing applications can upgrade without changing
|
|
79
|
+
their calls.
|
|
80
|
+
|
|
81
|
+
The stable pgContext 0.2.0 inventory is fully classified and has no missing SDK
|
|
82
|
+
entries. Database-native vector operators remain SQL-only, and five
|
|
83
|
+
backend-wide or privileged instrumentation functions remain available through
|
|
84
|
+
direct SQL rather than the project-scoped Runtime API. See the
|
|
85
|
+
[migration and coverage notes](migrations/pgcontext-0.2.0-names.md).
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
operation = project.context.register_vector(
|
|
89
|
+
collection_id,
|
|
90
|
+
"title_embedding",
|
|
91
|
+
768,
|
|
92
|
+
)
|
|
93
|
+
project.context.register_filter_column(
|
|
94
|
+
collection_id,
|
|
95
|
+
"tenant_id",
|
|
96
|
+
"tenant_id",
|
|
97
|
+
)
|
|
98
|
+
results = project.context.query(
|
|
99
|
+
"support_docs",
|
|
100
|
+
query_embedding,
|
|
101
|
+
query="refund policy",
|
|
102
|
+
)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The earlier `add_vector()`, `add_filter_column()`, and `text_hybrid()` names
|
|
106
|
+
remain silent compatibility aliases with unchanged behavior. See the
|
|
107
|
+
[pgContext naming migration](migrations/pgcontext-0.2.0-names.md) for the full
|
|
108
|
+
mapping.
|
|
109
|
+
|
|
58
110
|
## Vector retrieval
|
|
59
111
|
|
|
60
112
|
Generate the query embedding with the same model and dimensions used by the saved vector configuration.
|
|
@@ -232,7 +284,9 @@ Keep the request ID when reporting a problem. Never log or send the Project API
|
|
|
232
284
|
|
|
233
285
|
## Connection information
|
|
234
286
|
|
|
235
|
-
`connection_info()` returns project hosts and passwordless
|
|
287
|
+
For a standard project, `connection_info()` returns project hosts and passwordless
|
|
288
|
+
connection strings. It never returns the database password. It raises
|
|
289
|
+
`PolygresPermissionError` for a synchronized project.
|
|
236
290
|
|
|
237
291
|
```python
|
|
238
292
|
connection = project.connection_info()
|
|
@@ -269,11 +323,11 @@ payload and idempotency key.
|
|
|
269
323
|
|
|
270
324
|
## Version and support
|
|
271
325
|
|
|
272
|
-
Package version: [`0.
|
|
326
|
+
Package version: [`0.4.0`](https://github.com/Evokoa/polygres-sdk/releases/tag/polygres-sdk-v0.4.0).
|
|
273
327
|
|
|
274
328
|
When contacting support, include the installed SDK version and the request ID.
|
|
275
329
|
|
|
276
|
-
See the [SDK 0.
|
|
330
|
+
See the [SDK 0.4.0 release notes](https://github.com/Evokoa/polygres-sdk/releases/tag/polygres-sdk-v0.4.0) for release changes.
|
|
277
331
|
|
|
278
332
|
## Optional Agent Skill
|
|
279
333
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# SDK compatibility baseline 0.3.0
|
|
2
|
+
|
|
3
|
+
`python-sdk-v1.methods.json` is the explicit released SDK 0.3.0 public network
|
|
4
|
+
surface. It is copied byte-for-byte from the generated method contract at the
|
|
5
|
+
0.3.0 release boundary.
|
|
6
|
+
|
|
7
|
+
SDK 0.4.0 compatibility and release checks must name this file with
|
|
8
|
+
`--baseline`. The compatibility tool must classify the pgContext-aligned method
|
|
9
|
+
names as additive and must report no removals or breaking changes to this
|
|
10
|
+
baseline.
|