meilisearch-python-sdk 7.2.0__py3-none-any.whl → 7.2.2__py3-none-any.whl

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.
@@ -103,7 +103,7 @@ class AsyncClient(BaseClient):
103
103
  async def __aexit__(
104
104
  self,
105
105
  et: type[BaseException] | None,
106
- ev: type[BaseException] | None,
106
+ ev: BaseException | None,
107
107
  traceback: TracebackType | None,
108
108
  ) -> None:
109
109
  await self.aclose()
@@ -105,7 +105,7 @@ class Client(BaseClient):
105
105
  def __exit__(
106
106
  self,
107
107
  et: type[BaseException] | None,
108
- ev: type[BaseException] | None,
108
+ ev: BaseException | None,
109
109
  traceback: TracebackType | None,
110
110
  ) -> None:
111
111
  self.close()
@@ -25,6 +25,9 @@ def build_multi_search_payload(
25
25
  for query in queries:
26
26
  q = query.model_dump(by_alias=True)
27
27
 
28
+ if query.federation_options is None:
29
+ del q["federationOptions"]
30
+
28
31
  if query.retrieve_vectors is None:
29
32
  del q["retrieveVectors"]
30
33
 
@@ -77,7 +77,7 @@ class AsyncHttpRequests:
77
77
  raise MeilisearchCommunicationError(str(err)) from err
78
78
  except HTTPError as err:
79
79
  if "response" in locals():
80
- if "application/json" in response.headers.get("content-type", ""):
80
+ if "application/json" in response.headers.get("content-type", ""): # pyrefly: ignore[unbound-name]
81
81
  raise MeilisearchApiError(str(err), response) from err
82
82
  else:
83
83
  raise
@@ -165,7 +165,7 @@ class HttpRequests:
165
165
  raise MeilisearchCommunicationError(str(err)) from err
166
166
  except HTTPError as err:
167
167
  if "response" in locals():
168
- if "application/json" in response.headers.get("content-type", ""):
168
+ if "application/json" in response.headers.get("content-type", ""): # pyrefly: ignore[unbound-name]
169
169
  raise MeilisearchApiError(str(err), response) from err
170
170
  else:
171
171
  raise
@@ -207,6 +207,7 @@ class HttpRequests:
207
207
  return self._send_request(self.http_client.delete, path, body)
208
208
 
209
209
 
210
+ @lru_cache(maxsize=4)
210
211
  def build_headers(content_type: str, compress: bool) -> dict[str, str]:
211
212
  headers = {"user-agent": user_agent(), "Content-Type": content_type}
212
213
 
@@ -1 +1 @@
1
- VERSION = "7.2.0"
1
+ VERSION = "7.2.2"
@@ -56,12 +56,12 @@ class OrjsonHandler(_JsonHandler):
56
56
 
57
57
  @staticmethod
58
58
  def dumps(obj: Any) -> str: # noqa: ANN401
59
- return orjson.dumps(obj).decode("utf-8")
59
+ return orjson.dumps(obj).decode("utf-8") # pyrefly: ignore[missing-attribute]
60
60
 
61
61
  @staticmethod
62
62
  def dump_bytes(obj: Any) -> bytes: # noqa: ANN401
63
- return orjson.dumps(obj)
63
+ return orjson.dumps(obj) # pyrefly: ignore[missing-attribute]
64
64
 
65
65
  @staticmethod
66
66
  def loads(json_string: str | bytes | bytearray) -> Any: # noqa: ANN401
67
- return orjson.loads(json_string)
67
+ return orjson.loads(json_string) # pyrefly: ignore[missing-attribute]
@@ -42,9 +42,14 @@ class FederationMerged(Federation):
42
42
  merge_facets: MergeFacets | None
43
43
 
44
44
 
45
+ class FederationOptions(CamelBase):
46
+ weight: float
47
+
48
+
45
49
  class SearchParams(CamelBase):
46
50
  index_uid: str
47
51
  query: str | None = Field(None, alias="q")
52
+ federation_options: FederationOptions | None = None
48
53
  offset: int = 0
49
54
  limit: int = 20
50
55
  filter: Filter | None = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meilisearch-python-sdk
3
- Version: 7.2.0
3
+ Version: 7.2.2
4
4
  Summary: A Python client providing both async and sync support for the Meilisearch API
5
5
  Project-URL: repository, https://github.com/sanders41/meilisearch-python-sdk
6
6
  Project-URL: homepage, https://github.com/sanders41/meilisearch-python-sdk
@@ -1,20 +1,20 @@
1
1
  meilisearch_python_sdk/__init__.py,sha256=SB0Jlm6FwT13J9xasZKseZzTWBk0hkfe1CWyWmIIZnE,258
2
2
  meilisearch_python_sdk/_batch.py,sha256=PQyXyERVQwnxIFMthZ6zVqi2ZbQbMBs6TgUPdLbJLSY,5920
3
- meilisearch_python_sdk/_http_requests.py,sha256=0Txm751u9NLLe8N02WIVUaQS4YdBu5hSERKIyFSwESw,7764
3
+ meilisearch_python_sdk/_http_requests.py,sha256=81UPpbNIHsEUlaue5Cgn8WZ4M6byVcrzA7lAEkcd10I,7852
4
4
  meilisearch_python_sdk/_task.py,sha256=lQp2n5ZjD8HboEP6Xid0Z275Jcr4GuXwh_LzpVY5LAo,13189
5
5
  meilisearch_python_sdk/_utils.py,sha256=6Yy0tRe6V0kocVmaYb0rO2Hw2GmvEeY_XLY05P5bMq0,4317
6
- meilisearch_python_sdk/_version.py,sha256=h-sKsY3DipXbXKatvP6S0ohnqJja9xZwry6xGKpC-4Q,18
6
+ meilisearch_python_sdk/_version.py,sha256=yIWYNV-Rk04Dmvd5xWpbFu257um28skyfSH0jyTxGPo,18
7
7
  meilisearch_python_sdk/decorators.py,sha256=wgznbwCYRc1_nVfQaOgj7DcOMejB9mJIWqltW6CimnY,8836
8
8
  meilisearch_python_sdk/errors.py,sha256=VZAcq_72l1y1YMe56FOnxpQ9gV3sk8_ceT7FiHs_wYI,3176
9
- meilisearch_python_sdk/json_handler.py,sha256=cBJ3LtK7SRIJKgEg6MJ4XTSFUrNnZ2vSiTKdrg-56pk,2007
9
+ meilisearch_python_sdk/json_handler.py,sha256=lzwiBP4ASjdBiBLQAjp9akbL-9TnaWnu8Ayy380R_s0,2121
10
10
  meilisearch_python_sdk/plugins.py,sha256=ACk07_3ySHnz_clF3IiJRKeAlSGhpyQfn4taqAozIjo,3750
11
11
  meilisearch_python_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  meilisearch_python_sdk/types.py,sha256=nf-_ZjbPVGdVg-spkfFoaGebQvzmWqiDWuyBwR_qWJk,473
13
13
  meilisearch_python_sdk/_client/__init__.py,sha256=ld4FGQM5wt-Ygtt4z4UgZKL8dQ1jY98NY1Fst_-bhA4,164
14
- meilisearch_python_sdk/_client/_async_client.py,sha256=6PVZhROl9TrjieOTEnR2MG7Qlg_tWMKgKLITmmv9xjw,48828
14
+ meilisearch_python_sdk/_client/_async_client.py,sha256=OCIDZFx-UdlWcyCmt8FVpxOw0ZpIA-Z2i170ifNmk00,48822
15
15
  meilisearch_python_sdk/_client/_base_client.py,sha256=FfNigpAOibsjkzlMf2FOv68DRcVYp4D0Nii0RW3C-Tc,3992
16
- meilisearch_python_sdk/_client/_client.py,sha256=kyLIJfjWPAnXbJME5F522Aeo1qaxXYJxKreNBxpWafc,47319
17
- meilisearch_python_sdk/_client/_common.py,sha256=sunQLkOXwfg9k0w_OHJuVBmuivXPrP-l8PMtL14lbQw,2984
16
+ meilisearch_python_sdk/_client/_client.py,sha256=hsOdiyery3I6ksOvoX2BQvz_LFojhoYQMKFp8t_fozc,47313
17
+ meilisearch_python_sdk/_client/_common.py,sha256=7aMbLK5ZkuhA_I_2wUomgvVdGHVGF6DJgqfwzO7jnpw,3069
18
18
  meilisearch_python_sdk/index/__init__.py,sha256=sULiCF_Gqa66SDLuyvlHQ1NW-6ch5sWU6UNZ572sdEA,152
19
19
  meilisearch_python_sdk/index/_common.py,sha256=q6IqRpvmUIpOWuoa_XDuv_MsKB8XN1AQljgemN0Cha8,11009
20
20
  meilisearch_python_sdk/index/async_index.py,sha256=B1lSENtrPLx0W7VD3fyuh6lMsOx4zsGF_1N4nP93Ihk,208413
@@ -25,12 +25,12 @@ meilisearch_python_sdk/models/client.py,sha256=BlYQtckkREp3_-kvxSqGfn2UhFvDp23Qy
25
25
  meilisearch_python_sdk/models/documents.py,sha256=eT3FHrPND-g2IzNRyOHQApTTJ1WbFcGlqgxZ6aKrRgI,247
26
26
  meilisearch_python_sdk/models/health.py,sha256=hvruti7ylsk7bAh8RPOhTPcRrjx6MPgdkDFX9vZ5Qks,95
27
27
  meilisearch_python_sdk/models/index.py,sha256=7UpnXnstIFBysod_6ELy0723Oj8zXvGyJGla_T7sWn8,1745
28
- meilisearch_python_sdk/models/search.py,sha256=fpOUEq0oNYHJf2PoLRC7aajonpveTisdqwUk6VewSps,3695
28
+ meilisearch_python_sdk/models/search.py,sha256=tdgzELIWTlZTJreA-vAb15QID7fXXuSWh3TpQ5YA7aY,3807
29
29
  meilisearch_python_sdk/models/settings.py,sha256=lc0YYnqpMF3szWuKWAiGMKJGmqHO6HzmjhKdLet2z0Y,5747
30
30
  meilisearch_python_sdk/models/task.py,sha256=nDD-S7K-uL4gcYU-tyPstBWcnJi_8MiDwc53GG6i304,1105
31
31
  meilisearch_python_sdk/models/version.py,sha256=ISU-ZHgpXLBFDuMpWWfKdVo9Dq1HcD7s6HFnCiGTF8Y,184
32
32
  meilisearch_python_sdk/models/webhook.py,sha256=zSkEJJdEflinW3_seJTLQ_ZWs4w-pjTD3SS1ZawC32k,455
33
- meilisearch_python_sdk-7.2.0.dist-info/METADATA,sha256=p0ZevCV1QavfBmeaw47h_tlVrLe7fmgof81goHDFVuo,9597
34
- meilisearch_python_sdk-7.2.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
35
- meilisearch_python_sdk-7.2.0.dist-info/licenses/LICENSE,sha256=xVzevI1TrlKfM0plmJ7vfK1Muu0V9n-dGE8RnDrOFlM,1069
36
- meilisearch_python_sdk-7.2.0.dist-info/RECORD,,
33
+ meilisearch_python_sdk-7.2.2.dist-info/METADATA,sha256=mOcVnrqk1LQPMuWs5tlt5Zx6ZEFd9mTbNENnIyPxcwQ,9597
34
+ meilisearch_python_sdk-7.2.2.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
35
+ meilisearch_python_sdk-7.2.2.dist-info/licenses/LICENSE,sha256=xVzevI1TrlKfM0plmJ7vfK1Muu0V9n-dGE8RnDrOFlM,1069
36
+ meilisearch_python_sdk-7.2.2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.29.0
2
+ Generator: hatchling 1.30.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any