nucliadb-utils 5.0.1.post1107__py3-none-any.whl → 5.0.1.post1116__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.
@@ -60,6 +60,14 @@ class PineconeRateLimitError(PineconeAPIError):
60
60
  pass
61
61
 
62
62
 
63
+ class PineconeNeedsPlanUpgradeError(PineconeAPIError):
64
+ """
65
+ Raised when the client needs to upgrade the plan to continue using the service.
66
+ """
67
+
68
+ pass
69
+
70
+
63
71
  class MetadataTooLargeError(ValueError):
64
72
  """
65
73
  Raised when the metadata of a vector to be upserted is too large.
@@ -79,12 +87,19 @@ def raise_for_status(operation: str, response: httpx.Response):
79
87
  try:
80
88
  resp_json = response.json()
81
89
  error = resp_json.get("error") or {}
82
- code = error.get("code")
83
- message = error.get("message")
84
- details = error.get("details")
90
+ code = resp_json.get("code") or error.get("code")
91
+ message = resp_json.get("message") or error.get("message") or ""
92
+ details = resp_json.get("details") or error.get("details")
85
93
  except Exception: # pragma: no cover
86
94
  message = response.text
87
95
  if response.status_code == 429:
96
+ if "month" in message:
97
+ raise PineconeNeedsPlanUpgradeError(
98
+ http_status_code=response.status_code,
99
+ code=code,
100
+ message=message,
101
+ details=details,
102
+ )
88
103
  raise PineconeRateLimitError(
89
104
  http_status_code=response.status_code,
90
105
  code=code,
nucliadb_utils/const.py CHANGED
@@ -83,3 +83,4 @@ class Features:
83
83
  PG_CATALOG_WRITE = "nucliadb_pg_catalog_write"
84
84
  VECTORSETS_V0 = "vectorsets_v0_new_kbs_with_multiple_vectorsets"
85
85
  SKIP_EXTERNAL_INDEX = "nucliadb_skip_external_index"
86
+ NATS_ASYNC_ACK = "nucliadb_nats_async_ack"
@@ -81,6 +81,10 @@ DEFAULT_FLAG_DATA: dict[str, Any] = {
81
81
  "rollout": 0,
82
82
  "variants": {"environment": ["none"]},
83
83
  },
84
+ const.Features.NATS_ASYNC_ACK: {
85
+ "rollout": 0,
86
+ "variants": {"environment": ["local"]},
87
+ },
84
88
  }
85
89
 
86
90
 
nucliadb_utils/nats.py CHANGED
@@ -74,6 +74,7 @@ class MessageProgressUpdater:
74
74
  try:
75
75
  await self._task
76
76
  except asyncio.CancelledError: # pragma: no cover
77
+ logger.info("MessageProgressUpdater cancelled")
77
78
  pass
78
79
  except Exception as exc: # pragma: no cover
79
80
  capture_exception(exc)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nucliadb_utils
3
- Version: 5.0.1.post1107
3
+ Version: 5.0.1.post1116
4
4
  Home-page: https://nuclia.com
5
5
  License: BSD
6
6
  Classifier: Development Status :: 4 - Beta
@@ -24,8 +24,8 @@ Requires-Dist: PyNaCl
24
24
  Requires-Dist: pyjwt>=2.4.0
25
25
  Requires-Dist: memorylru>=1.1.2
26
26
  Requires-Dist: mrflagly>=0.2.9
27
- Requires-Dist: nucliadb-protos>=5.0.1.post1107
28
- Requires-Dist: nucliadb-telemetry>=5.0.1.post1107
27
+ Requires-Dist: nucliadb-protos>=5.0.1.post1116
28
+ Requires-Dist: nucliadb-telemetry>=5.0.1.post1116
29
29
  Provides-Extra: cache
30
30
  Requires-Dist: redis>=4.3.4; extra == "cache"
31
31
  Requires-Dist: orjson>=3.6.7; extra == "cache"
@@ -1,14 +1,14 @@
1
1
  nucliadb_utils/__init__.py,sha256=EvBCH1iTODe-AgXm48aj4kVUt_Std3PeL8QnwimR5wI,895
2
2
  nucliadb_utils/asyncio_utils.py,sha256=h8Y-xpcFFRgNzaiIW0eidz7griAQa7ggbNk34-tAt2c,2888
3
3
  nucliadb_utils/authentication.py,sha256=N__d2Ez3JHJv5asYK5TgUcIkKqcAC8ZTLlnfLhfSneM,5837
4
- nucliadb_utils/const.py,sha256=ERzAa78DCPnE7ln9ChjP7A3ILdA_qGd9HStosBZkqwQ,2676
4
+ nucliadb_utils/const.py,sha256=AYtxOqOoyDXYzsca0UTXbt6ACZsgoyfItorybDGKHdc,2723
5
5
  nucliadb_utils/debug.py,sha256=Q56Nx9Dp7V2ae3CU2H0ztaZcHTJXdlflPLKLeOPZ170,2436
6
6
  nucliadb_utils/exceptions.py,sha256=y_3wk77WLVUtdo-5FtbBsdSkCtK_DsJkdWb5BoPn3qo,1094
7
- nucliadb_utils/featureflagging.py,sha256=0nN3vmtaEs6rB2uFQn0kI88It9568gcZ0GWWeWI1AOk,3308
7
+ nucliadb_utils/featureflagging.py,sha256=H_qW7nE2k5wS7mv1m5SXayuvDDhTHYPwqTfW5-eVzEI,3422
8
8
  nucliadb_utils/grpc.py,sha256=apu0uePnkGHCAT7GRQ9YZfRYyFj26kJ440i8jitbM3U,3314
9
9
  nucliadb_utils/helpers.py,sha256=nPw8yod3hP-pxq80VF8QC36s7ygSg0dBUdfI-LatvCs,1600
10
10
  nucliadb_utils/indexing.py,sha256=Luaqcar3CySpdYOFp6Q9Fyr8ZYwhYhaKRHQ_VGL78f8,2318
11
- nucliadb_utils/nats.py,sha256=b7_ZqBTtacnfTeErfeozXTLXbTL27JwqF1-SUEe9VmM,8370
11
+ nucliadb_utils/nats.py,sha256=prs98dIrGh2-WchQcRBloc5wYhpjEnB0VtCERPnoReg,8430
12
12
  nucliadb_utils/partition.py,sha256=jBgy4Hu5Iwn4gjbPPcthSykwf-qNx-GcLAIwbzPd1d0,1157
13
13
  nucliadb_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  nucliadb_utils/run.py,sha256=HpAIM8xbR7UpVC2_7xOjB4fYbUVykyPP6yHrv2RD3DI,1707
@@ -19,7 +19,7 @@ nucliadb_utils/transaction.py,sha256=mwcI3aIHAvU5KOGqd_Uz_d1XQzXhk_-NWY8NqU1lfb0
19
19
  nucliadb_utils/utilities.py,sha256=idajCm_4Sojh7b3HTkP0fTfG2Mb6PIB9xtMmcfB7Nl0,15758
20
20
  nucliadb_utils/aiopynecone/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
21
21
  nucliadb_utils/aiopynecone/client.py,sha256=3DGJuHXO9Vm83atMLD4fd2FTz8SAr8RvPCGU_bXH9Ho,22333
22
- nucliadb_utils/aiopynecone/exceptions.py,sha256=EEE0XoGs1zIB5yOJ_fy6yoG4uIb4cWIawYdJeNe4eDo,3012
22
+ nucliadb_utils/aiopynecone/exceptions.py,sha256=yfUXIADRuhPb2rNynoFRlpQ6QINm1EkmvT_BbZ7dv8I,3536
23
23
  nucliadb_utils/aiopynecone/models.py,sha256=ketK2IYLWiwFZ76rnJmwfcuopFJrCAtCUszdTSurm_Q,3236
24
24
  nucliadb_utils/audit/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
25
25
  nucliadb_utils/audit/audit.py,sha256=Tbi8poUP6BKZy4ZsaFaeTaQ1K5ys8GXym5ps389-XHE,2966
@@ -64,8 +64,8 @@ nucliadb_utils/tests/indexing.py,sha256=YW2QhkhO9Q_8A4kKWJaWSvXvyQ_AiAwY1VylcfVQ
64
64
  nucliadb_utils/tests/local.py,sha256=7nuP8EFUAiA8ZH50R1iPV9EUXBySQxOanVm3Zht_e0g,1835
65
65
  nucliadb_utils/tests/nats.py,sha256=xqpww4jZjTKY9oPGlJdDJG67L3FIBQsa9qDHxILR8r8,7687
66
66
  nucliadb_utils/tests/s3.py,sha256=IdMxK_cNdSHLvO1u8BwsKFzD87Hk1MVPDZ57zx6h-rA,3656
67
- nucliadb_utils-5.0.1.post1107.dist-info/METADATA,sha256=tiIC4Np-x49gLu5SMMyBIwNmtiq_5L0HNuMIGX3UgyA,2071
68
- nucliadb_utils-5.0.1.post1107.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
69
- nucliadb_utils-5.0.1.post1107.dist-info/top_level.txt,sha256=fE3vJtALTfgh7bcAWcNhcfXkNPp_eVVpbKK-2IYua3E,15
70
- nucliadb_utils-5.0.1.post1107.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
71
- nucliadb_utils-5.0.1.post1107.dist-info/RECORD,,
67
+ nucliadb_utils-5.0.1.post1116.dist-info/METADATA,sha256=KpdqhX5ztjM8y5_ScL4v-NM9eAhMDLxbtJDEzeoXv6s,2071
68
+ nucliadb_utils-5.0.1.post1116.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
69
+ nucliadb_utils-5.0.1.post1116.dist-info/top_level.txt,sha256=fE3vJtALTfgh7bcAWcNhcfXkNPp_eVVpbKK-2IYua3E,15
70
+ nucliadb_utils-5.0.1.post1116.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
71
+ nucliadb_utils-5.0.1.post1116.dist-info/RECORD,,