Skip to content

Commit 6e823f3

Browse files
committed
Merge branch 'main' of https://github.com/weaviate/weaviate-python-client into stefan/readthedocs-update
2 parents 8753691 + ee23524 commit 6e823f3

214 files changed

Lines changed: 12467 additions & 6658 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ concurrency:
1919

2020
env:
2121
WEAVIATE_124: 1.24.26
22-
WEAVIATE_125: stable-v1.25-58e6503
23-
WEAVIATE_126: 1.26.17-c1737a0
24-
WEAVIATE_127: 1.27.15
25-
WEAVIATE_128: 1.28.10
22+
WEAVIATE_125: 1.25.34
23+
WEAVIATE_126: 1.26.17
24+
WEAVIATE_127: 1.27.14
25+
WEAVIATE_128: 1.28.8
2626
WEAVIATE_129: 1.29.1
27+
WEAVIATE_130: 1.30.0-rc.0-c1830a7-amd64
2728

2829
jobs:
2930
lint-and-format:
@@ -64,11 +65,9 @@ jobs:
6465
python-version: ${{ matrix.version }}
6566
cache: 'pip' # caching pip dependencies
6667
- run: pip install -r requirements-devel.txt
67-
- name: Run mypy
68-
run: mypy --config-file ./pyproject.toml --warn-unused-ignores --python-version ${{matrix.version}} ${{ matrix.folder }}
6968
- uses: jakebailey/pyright-action@v2
7069
with:
71-
version: 1.1.347
70+
version: 1.1.398
7271

7372
unit-tests:
7473
name: Run Unit Tests
@@ -130,11 +129,11 @@ jobs:
130129
fail-fast: false
131130
matrix:
132131
versions: [
133-
{ py: "3.9", weaviate: $WEAVIATE_129},
134-
{ py: "3.10", weaviate: $WEAVIATE_129},
135-
{ py: "3.11", weaviate: $WEAVIATE_129},
136-
{ py: "3.12", weaviate: $WEAVIATE_129},
137-
{ py: "3.13", weaviate: $WEAVIATE_129}
132+
{ py: "3.9", weaviate: $WEAVIATE_130},
133+
{ py: "3.10", weaviate: $WEAVIATE_130},
134+
{ py: "3.11", weaviate: $WEAVIATE_130},
135+
{ py: "3.12", weaviate: $WEAVIATE_130},
136+
{ py: "3.13", weaviate: $WEAVIATE_130}
138137
]
139138
optional_dependencies: [false]
140139
steps:
@@ -168,7 +167,7 @@ jobs:
168167
run: pytest -n auto --dist loadgroup -v --cov --cov-report=term-missing --cov=weaviate --cov-report xml:coverage-integration.xml integration
169168
- name: Run integration tests without auth secrets (for forks)
170169
if: ${{ github.event.pull_request.head.repo.fork }}
171-
run: pytest -v --cov --cov-report=term-missing --cov=weaviate --cov-report xml:coverage-integration.xml integration
170+
run: pytest -n auto --dist loadgroup -v --cov --cov-report=term-missing --cov=weaviate --cov-report xml:coverage-integration.xml integration
172171
- name: Archive code coverage results
173172
if: matrix.versions.py == '3.10' && (github.ref_name != 'main')
174173
uses: actions/upload-artifact@v4
@@ -279,7 +278,8 @@ jobs:
279278
$WEAVIATE_126,
280279
$WEAVIATE_127,
281280
$WEAVIATE_128,
282-
$WEAVIATE_129
281+
$WEAVIATE_129,
282+
$WEAVIATE_130
283283
]
284284
steps:
285285
- name: Checkout

.pre-commit-config.yaml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,6 @@ repos:
3636
]
3737
files: '^weaviate/collections'
3838

39-
- repo: local
40-
hooks:
41-
- id: mypy
42-
name: mypy
43-
entry: ./run-mypy.sh
44-
language: python
45-
language_version: "3.12"
46-
# use require_serial so that script
47-
# is only called once per commit
48-
require_serial: true
49-
# Print the number of files as a sanity-check
50-
verbose: true
51-
5239
- repo: local
5340
hooks:
5441
- id: pyright
@@ -57,4 +44,4 @@ repos:
5744
language: node
5845
pass_filenames: false
5946
types: [python]
60-
additional_dependencies: [pyright@1.1.364]
47+
additional_dependencies: [pyright@1.1.398]

ci/docker-compose-cluster.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ services:
2222
CONTEXTIONARY_URL: contextionary:9999
2323
DEFAULT_VECTORIZER_MODULE: text2vec-contextionary
2424
ENABLE_MODULES: text2vec-contextionary
25+
AUTOSCHEMA_ENABLED: 'false'
2526

2627
weaviate-node-2:
2728
init: true
@@ -54,6 +55,7 @@ services:
5455
CONTEXTIONARY_URL: contextionary:9999
5556
DEFAULT_VECTORIZER_MODULE: text2vec-contextionary
5657
ENABLE_MODULES: text2vec-contextionary
58+
AUTOSCHEMA_ENABLED: 'false'
5759

5860
weaviate-node-3:
5961
init: true
@@ -86,4 +88,5 @@ services:
8688
CONTEXTIONARY_URL: contextionary:9999
8789
DEFAULT_VECTORIZER_MODULE: text2vec-contextionary
8890
ENABLE_MODULES: text2vec-contextionary
91+
AUTOSCHEMA_ENABLED: 'false'
8992
...

ci/docker-compose-rbac.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,10 @@ services:
2727
CLUSTER_DATA_BIND_PORT: "7101"
2828
RAFT_BOOTSTRAP_EXPECT: "1"
2929
AUTHORIZATION_ENABLE_RBAC: "true"
30+
AUTHENTICATION_DB_USERS_ENABLED: "true"
31+
AUTHENTICATION_OIDC_ENABLED: 'true'
32+
AUTHENTICATION_OIDC_CLIENT_ID: 'wcs'
33+
AUTHENTICATION_OIDC_ISSUER: 'https://auth.wcs.api.weaviate.io/auth/realms/SeMI'
34+
AUTHENTICATION_OIDC_USERNAME_CLAIM: 'email'
35+
AUTHENTICATION_OIDC_GROUPS_CLAIM: 'groups'
3036
...

ci/docker-compose-wcs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ services:
2424
AUTHENTICATION_OIDC_USERNAME_CLAIM: 'email'
2525
AUTHENTICATION_OIDC_GROUPS_CLAIM: 'groups'
2626
AUTHORIZATION_ADMINLIST_ENABLED: 'true'
27-
AUTHORIZATION_ADMINLIST_USERS: 'ms_2d0e007e7136de11d5f29fce7a53dae219a51458@existiert.net'
27+
AUTHORIZATION_ADMINLIST_USERS: 'oidc-test-user@weaviate.io'
2828
AUTHENTICATION_OIDC_SCOPES: 'openid,email'
2929
AUTHENTICATION_APIKEY_ENABLED: 'true'
3030
AUTHENTICATION_APIKEY_ALLOWED_KEYS: 'my-secret-key'
31-
AUTHENTICATION_APIKEY_USERS: 'ms_2d0e007e7136de11d5f29fce7a53dae219a51458@existiert.net'
31+
AUTHENTICATION_APIKEY_USERS: 'oidc-test-user@weaviate.io'
3232
DISABLE_TELEMETRY: 'true'
3333
...

docs/changelog.rst

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
11
Changelog
22
=========
33

4+
Version 4.13.2
5+
--------------
6+
This patch version includes:
7+
- Fixes a parsing bug when providing URLs with ``GenerativeConfig`` for runtime generate queries
8+
9+
Version 4.13.1
10+
--------------
11+
This patch version includes:
12+
- Fixes ``generative.near_text()`` to not require ``generative_provider``
13+
14+
Version 4.13.0
15+
--------------
16+
This minor version provides a complete top-down refactor of the underlying transport for the sync and async clients.
17+
- Introduction of a dependency injection system whereby the sync/async connections are injected into each client independently thereby removing their cross-dependency.
18+
- Removal of the ``event_loop.py`` file and all logic surrounding its usage by the sync client.
19+
- Refactoring of the batching algorithm to use blocking threads with a sync connection, rather than the event loop sidecar thread.
20+
21+
22+
Version 4.12.1
23+
--------------
24+
This patch version includes:
25+
- Renames ``GenerativeConfig.openai_azure`` to ``GenerativeConfig.azure_openai`` to align with the convention of ``Configure.Generative.azure_openai``
26+
27+
Version 4.12.0
28+
--------------
29+
This minor version includes:
30+
- Support for new 1.30 features:
31+
- Dynamic user management of OIDC and native DB users
32+
- Improved multi-dimensional/colBERT vectors
33+
- Query-time configuration of generative modules
34+
- Tenant-based filtering of data permissions in RBAC
35+
- The new ``generative-xai`` module
36+
37+
438
Version 4.11.3
539
--------------
640
This patch version includes:
@@ -35,7 +69,7 @@ Version 4.11.0
3569
This minor version includes:
3670
- Support for new 1.29 features:
3771
- RBAC is ready for production
38-
- Multi-dimensional/COLBert vectors experimental, breaking changes are expected)
72+
- Multi-dimensional/COLBert vectors experimental, breaking changes are expected
3973
- Aggregations are using GRPC now
4074
- Improved exception handling for errors returned by Weaviate
4175
- Add support for NVIDIA modules:

integration/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def _factory(
131131
reranker_config: Optional[_RerankerProvider] = None,
132132
) -> Collection[Any, Any]:
133133
try:
134-
nonlocal client_fixture, name_fixtures, call_counter
134+
nonlocal client_fixture, name_fixtures, call_counter # noqa: F824
135135
call_counter += 1
136136
name_fixture = (
137137
_sanitize_collection_name(request.node.fspath.basename + "_" + request.node.name)
@@ -268,7 +268,7 @@ async def _factory(
268268
reranker_config: Optional[_RerankerProvider] = None,
269269
) -> CollectionAsync[Any, Any]:
270270
try:
271-
nonlocal client_fixture, name_fixtures
271+
nonlocal client_fixture, name_fixtures # noqa: F824
272272
name_fixture = _sanitize_collection_name(request.node.name) + name
273273
name_fixtures.append(name_fixture)
274274
client_fixture = await async_client_factory(

integration/test_auth.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ def test_authentication_client_credentials(
6666
@pytest.mark.parametrize(
6767
"name,user,env_variable_name,port,scope,warning",
6868
[
69-
# ( # WCS keycloak times out too often
70-
# "WCS",
71-
# "ms_2d0e007e7136de11d5f29fce7a53dae219a51458@existiert.net",
72-
# "WCS_DUMMY_CI_PW",
73-
# WCS_PORT,
74-
# None,
75-
# False,
76-
# ),
69+
( # WCS keycloak times out too often
70+
"WCS",
71+
"oidc-test-user@weaviate.io",
72+
"WCS_DUMMY_CI_PW",
73+
WCS_PORT,
74+
None,
75+
False,
76+
),
7777
(
7878
"okta",
7979
"test@test.de",
@@ -137,6 +137,9 @@ def test_client_with_authentication_with_anon_weaviate() -> None:
137137
with pytest.warns(UserWarning) as recwarn:
138138
with weaviate.connect_to_local(auth_credentials=auth) as client:
139139
client.collections.list_all()
140+
if len(recwarn) > 1:
141+
for rwarning in recwarn.list:
142+
print(rwarning.message)
140143
assert len(recwarn) == 1
141144
assert str(recwarn.list[0].message).startswith("Auth001")
142145

@@ -168,12 +171,12 @@ def _get_access_token(url: str, user: str, pw: str) -> Dict[str, str]:
168171
@pytest.mark.parametrize(
169172
"name,user,env_variable_name,port",
170173
[
171-
# ( # WCS keycloak times out too often
172-
# "WCS",
173-
# "ms_2d0e007e7136de11d5f29fce7a53dae219a51458@existiert.net",
174-
# "WCS_DUMMY_CI_PW",
175-
# WCS_PORT,
176-
# ),
174+
( # WCS keycloak times out too often
175+
"WCS",
176+
"oidc-test-user@weaviate.io",
177+
"WCS_DUMMY_CI_PW",
178+
WCS_PORT,
179+
),
177180
(
178181
"okta",
179182
"test@test.de",
@@ -200,7 +203,7 @@ def test_authentication_with_bearer_token(
200203
refresh_token=token["refresh_token"],
201204
)
202205
with weaviate.connect_to_local(port=port, auth_credentials=auth) as client:
203-
client.collections.list_all()
206+
client.collections.exists("something")
204207

205208

206209
def test_authentication_with_bearer_token_no_refresh() -> None:

integration/test_backup_v4.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@
7272
"datePublished": datetime.datetime.now(datetime.timezone.utc).isoformat(),
7373
},
7474
]
75+
CLASSES = ["Paragraph", "Article"]
7576

7677

7778
@pytest.fixture(scope="module")
7879
def client() -> Generator[weaviate.WeaviateClient, None, None]:
7980
client = weaviate.connect_to_local()
80-
client.collections.delete("Paragraph")
81-
client.collections.delete("Article")
81+
client.collections.delete(CLASSES)
8282

8383
col_para = client.collections.create(
8484
name="Paragraph",
@@ -123,7 +123,9 @@ def test_create_and_restore_backup_with_waiting(client: weaviate.WeaviateClient)
123123

124124
# create backup
125125
classes = ["Article", "Paragraph"]
126-
resp = client.backup.create(backup_id=backup_id, backend=BACKEND, wait_for_completion=True)
126+
resp = client.backup.create(
127+
backup_id=backup_id, backend=BACKEND, wait_for_completion=True, include_collections=CLASSES
128+
)
127129
assert resp.status == BackupStatus.SUCCESS
128130
for cls in classes:
129131
assert cls in resp.collections
@@ -141,7 +143,9 @@ def test_create_and_restore_backup_with_waiting(client: weaviate.WeaviateClient)
141143
client.collections.delete("Paragraph")
142144

143145
# restore backup
144-
restore = client.backup.restore(backup_id=backup_id, backend=BACKEND, wait_for_completion=True)
146+
restore = client.backup.restore(
147+
backup_id=backup_id, backend=BACKEND, wait_for_completion=True, include_collections=CLASSES
148+
)
145149
assert restore.status == BackupStatus.SUCCESS
146150
for cls in classes:
147151
assert cls in resp.collections
@@ -349,14 +353,14 @@ def test_fail_creating_backup_for_both_include_and_exclude_classes(
349353

350354

351355
@pytest.mark.parametrize("dynamic_backup_location", [False, True])
352-
def test_backup_and_restore_with_collection(
356+
def test_backup_and_restore_with_dynamic_location(
353357
client: weaviate.WeaviateClient, dynamic_backup_location: bool, tmp_path: pathlib.Path
354358
) -> None:
355359
backup_id = _create_backup_id()
356360

357361
conf_create: Optional[wvc.backup.BackupConfigCreate] = None
358362
conf_restore: Optional[wvc.backup.BackupConfigRestore] = None
359-
backup_location: Optional[wvc.backup.BackupLocation] = None
363+
backup_location: Optional[wvc.backup.BackupLocationType] = None
360364
if dynamic_backup_location:
361365
if client._connection._weaviate_version.is_lower_than(1, 27, 2):
362366
pytest.skip("Cancel backups is only supported from 1.27.2")
@@ -505,15 +509,18 @@ def test_cancel_backup(
505509
if client._connection._weaviate_version.is_lower_than(1, 24, 25):
506510
pytest.skip("Cancel backups is only supported from 1.24.25")
507511

508-
backup_location: Optional[wvc.backup.BackupLocation] = None
512+
backup_location: Optional[wvc.backup.BackupLocationType] = None
509513
if dynamic_backup_location:
510514
if client._connection._weaviate_version.is_lower_than(1, 27, 2):
511515
pytest.skip("Cancel backups is only supported from 1.27.2")
512516

513517
backup_location = wvc.backup.BackupLocation.FileSystem(path=str(tmp_path))
514518

515519
resp = client.backup.create(
516-
backup_id=backup_id, backend=BACKEND, backup_location=backup_location
520+
backup_id=backup_id,
521+
backend=BACKEND,
522+
backup_location=backup_location,
523+
include_collections=CLASSES,
517524
)
518525
assert resp.status == BackupStatus.STARTED
519526

integration/test_batch_v4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def client_factory(
8888
def _factory(
8989
name: str = "", ports: Tuple[int, int] = (8080, 50051), multi_tenant: bool = False
9090
) -> Tuple[weaviate.WeaviateClient, str]:
91-
nonlocal client_fixture, name_fixtures
91+
nonlocal client_fixture, name_fixtures # noqa: F824
9292
name_fixture = _sanitize_collection_name(request.node.name) + name
9393
name_fixtures.append(name_fixture)
9494
if client_fixture is None:

0 commit comments

Comments
 (0)