Skip to content

Commit 8c67865

Browse files
committed
Merge remote-tracking branch 'origin/main' into meilisearch-1.3.0
2 parents e7a5b45 + da56243 commit 8c67865

File tree

4 files changed

+157
-148
lines changed

4 files changed

+157
-148
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
- id: mypy
2121
additional_dependencies: [pydantic, types-aiofiles]
2222
- repo: https://github.com/astral-sh/ruff-pre-commit
23-
rev: v0.0.278
23+
rev: v0.0.280
2424
hooks:
2525
- id: ruff
2626
args: [--fix, --exit-non-zero-on-fix]

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,16 @@ This test compares how long it takes to complete 1000 searches (lower is better)
143143

144144
![Multiple Searches](https://raw.githubusercontent.com/sanders41/meilisearch-python-async/main/assets/searches.png)
145145

146+
### Independent testing
147+
148+
[Prashanth Rao](https://github.com/prrao87) did some independent testing and found this async client
149+
to be ~30 faster than the sync client. You can find a good write-up of how he tested and the results
150+
in his [blog post](https://thedataquarry.com/posts/meilisearch-async/).
151+
146152
## Documentation
147153

148154
See our [docs](https://meilisearch-python-async.paulsanders.dev) for the full documentation.
149155

150156
## Contributing
151157

152-
Contributions to this project are welcome. If you are interesting in contributing please see our [contributing guide](CONTRIBUTING.md)
158+
Contributions to this project are welcome. If you are interested in contributing please see our [contributing guide](CONTRIBUTING.md)

meilisearch_python_async/index.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async def delete(self) -> TaskInfo:
9090
>>> index = client.index("movies")
9191
>>> await index.delete()
9292
"""
93-
url = f"{self._base_url_with_uid}"
93+
url = self._base_url_with_uid
9494
response = await self._http_requests.delete(url)
9595
return TaskInfo(**response.json())
9696

@@ -144,7 +144,7 @@ async def update(self, primary_key: str) -> Index:
144144
>>> updated_index = await index.update()
145145
"""
146146
payload = {"primaryKey": primary_key}
147-
url = f"{self._base_url_with_uid}"
147+
url = self._base_url_with_uid
148148
response = await self._http_requests.patch(url, payload)
149149
await wait_for_task(self.http_client, response.json()["taskUid"], timeout_in_ms=100000)
150150
index_response = await self._http_requests.get(f"{url}")
@@ -170,7 +170,7 @@ async def fetch_info(self) -> Index:
170170
>>> index = client.index("movies")
171171
>>> index_info = await index.fetch_info()
172172
"""
173-
url = f"{self._base_url_with_uid}"
173+
url = self._base_url_with_uid
174174
response = await self._http_requests.get(url)
175175
index_dict = response.json()
176176
self.primary_key = index_dict["primaryKey"]
@@ -274,7 +274,7 @@ async def get_stats(self) -> IndexStats:
274274
>>> index = client.index("movies")
275275
>>> stats = await index.get_stats()
276276
"""
277-
url = f"{self._stats_url}"
277+
url = self._stats_url
278278
response = await self._http_requests.get(url)
279279

280280
return IndexStats(**response.json())
@@ -636,7 +636,7 @@ async def add_documents(
636636
>>> index = client.index("movies")
637637
>>> await index.add_documents(documents)
638638
"""
639-
url = f"{self._documents_url}"
639+
url = self._documents_url
640640
if primary_key:
641641
formatted_primary_key = urlencode({"primaryKey": primary_key})
642642
url = f"{url}?{formatted_primary_key}"
@@ -1047,7 +1047,7 @@ async def update_documents(
10471047
>>> index = client.index("movies")
10481048
>>> await index.update_documents(documents)
10491049
"""
1050-
url = f"{self._documents_url}"
1050+
url = self._documents_url
10511051
if primary_key:
10521052
formatted_primary_key = urlencode({"primaryKey": primary_key})
10531053
url = f"{url}?{formatted_primary_key}"
@@ -1557,7 +1557,7 @@ async def delete_all_documents(self) -> TaskInfo:
15571557
>>> index = client.index("movies")
15581558
>>> await index.delete_all_document()
15591559
"""
1560-
url = f"{self._documents_url}"
1560+
url = self._documents_url
15611561
response = await self._http_requests.delete(url)
15621562

15631563
return TaskInfo(**response.json())
@@ -1581,7 +1581,7 @@ async def get_settings(self) -> MeilisearchSettings:
15811581
>>> index = client.index("movies")
15821582
>>> settings = await index.get_settings()
15831583
"""
1584-
url = f"{self._settings_url}"
1584+
url = self._settings_url
15851585
response = await self._http_requests.get(url)
15861586

15871587
return MeilisearchSettings(**response.json())
@@ -1634,7 +1634,7 @@ async def update_settings(self, body: MeilisearchSettings) -> TaskInfo:
16341634
else: # pragma: no cover
16351635
body_dict = {k: v for k, v in body.dict(by_alias=True).items() if v is not None} # type: ignore[attr-defined]
16361636

1637-
url = f"{self._settings_url}"
1637+
url = self._settings_url
16381638
response = await self._http_requests.patch(url, body_dict)
16391639

16401640
return TaskInfo(**response.json())
@@ -1658,7 +1658,7 @@ async def reset_settings(self) -> TaskInfo:
16581658
>>> index = client.index("movies")
16591659
>>> await index.reset_settings()
16601660
"""
1661-
url = f"{self._settings_url}"
1661+
url = self._settings_url
16621662
response = await self._http_requests.delete(url)
16631663

16641664
return TaskInfo(**response.json())

0 commit comments

Comments
 (0)