nucliadb-utils 2.45.0.post371__py3-none-any.whl → 2.45.0.post372__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.
- nucliadb_utils/asyncio_utils.py +6 -0
- nucliadb_utils/const.py +1 -0
- nucliadb_utils/featureflagging.py +4 -0
- nucliadb_utils/tests/unit/test_asyncio_utils.py +2 -1
- {nucliadb_utils-2.45.0.post371.dist-info → nucliadb_utils-2.45.0.post372.dist-info}/METADATA +3 -3
- {nucliadb_utils-2.45.0.post371.dist-info → nucliadb_utils-2.45.0.post372.dist-info}/RECORD +9 -9
- {nucliadb_utils-2.45.0.post371.dist-info → nucliadb_utils-2.45.0.post372.dist-info}/WHEEL +0 -0
- {nucliadb_utils-2.45.0.post371.dist-info → nucliadb_utils-2.45.0.post372.dist-info}/top_level.txt +0 -0
- {nucliadb_utils-2.45.0.post371.dist-info → nucliadb_utils-2.45.0.post372.dist-info}/zip-safe +0 -0
nucliadb_utils/asyncio_utils.py
CHANGED
@@ -69,6 +69,12 @@ async def run_concurrently(
|
|
69
69
|
Runs a list of coroutines concurrently, with a maximum number of tasks running.
|
70
70
|
Returns the results of the coroutines in the order they were scheduled.
|
71
71
|
"""
|
72
|
+
if len(tasks) == 0:
|
73
|
+
return []
|
74
|
+
|
75
|
+
if len(tasks) == 1:
|
76
|
+
return [await tasks[0]]
|
77
|
+
|
72
78
|
runner = ConcurrentRunner(max_tasks=max_concurrent)
|
73
79
|
for task in tasks:
|
74
80
|
runner.schedule(task)
|
nucliadb_utils/const.py
CHANGED
@@ -76,6 +76,7 @@ class Features:
|
|
76
76
|
EXPERIMENTAL_KB = "nucliadb_experimental_kb"
|
77
77
|
READ_REPLICA_SEARCHES = "nucliadb_read_replica_searches"
|
78
78
|
VERSIONED_PRIVATE_PREDICT = "nucliadb_versioned_private_predict"
|
79
|
+
PREDICT_QUERY_ENDPOINT = "nucliadb_predict_query_endpoint"
|
79
80
|
BACK_PRESSURE = "nucliadb_back_pressure"
|
80
81
|
REBALANCE_KB = "nucliadb_rebalance_kb"
|
81
82
|
CORS_MIDDLEWARE = "nucliadb_cors_middleware_enabled"
|
@@ -53,6 +53,10 @@ DEFAULT_FLAG_DATA: dict[str, Any] = {
|
|
53
53
|
"rollout": 0,
|
54
54
|
"variants": {"environment": ["local"]},
|
55
55
|
},
|
56
|
+
const.Features.PREDICT_QUERY_ENDPOINT: {
|
57
|
+
"rollout": 0,
|
58
|
+
"variants": {"environment": ["local"]},
|
59
|
+
},
|
56
60
|
const.Features.BACK_PRESSURE: {
|
57
61
|
"rollout": 0,
|
58
62
|
"variants": {"environment": ["local"]},
|
@@ -30,7 +30,8 @@ async def test_run_concurrently():
|
|
30
30
|
await asyncio.sleep(random.uniform(0.0, 0.5))
|
31
31
|
return value
|
32
32
|
|
33
|
-
|
33
|
+
tasks = [mycoro(i) for i in range(10)]
|
34
|
+
results = await run_concurrently(tasks)
|
34
35
|
assert results == list(range(10))
|
35
36
|
|
36
37
|
|
{nucliadb_utils-2.45.0.post371.dist-info → nucliadb_utils-2.45.0.post372.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nucliadb-utils
|
3
|
-
Version: 2.45.0.
|
3
|
+
Version: 2.45.0.post372
|
4
4
|
Home-page: https://nuclia.com
|
5
5
|
License: BSD
|
6
6
|
Classifier: Development Status :: 4 - Beta
|
@@ -21,8 +21,8 @@ Requires-Dist: nats-py[nkeys] >=2.6.0
|
|
21
21
|
Requires-Dist: pyjwt >=2.4.0
|
22
22
|
Requires-Dist: memorylru >=1.1.2
|
23
23
|
Requires-Dist: mrflagly
|
24
|
-
Requires-Dist: nucliadb-protos >=2.45.0.
|
25
|
-
Requires-Dist: nucliadb-telemetry >=2.45.0.
|
24
|
+
Requires-Dist: nucliadb-protos >=2.45.0.post372
|
25
|
+
Requires-Dist: nucliadb-telemetry >=2.45.0.post372
|
26
26
|
Provides-Extra: cache
|
27
27
|
Requires-Dist: redis >=4.3.4 ; extra == 'cache'
|
28
28
|
Requires-Dist: orjson >=3.6.7 ; extra == 'cache'
|
@@ -1,10 +1,10 @@
|
|
1
1
|
nucliadb_utils/__init__.py,sha256=EvBCH1iTODe-AgXm48aj4kVUt_Std3PeL8QnwimR5wI,895
|
2
|
-
nucliadb_utils/asyncio_utils.py,sha256=
|
2
|
+
nucliadb_utils/asyncio_utils.py,sha256=9A0xwlw9E4HYAxiPtLlOzurqiTlCWNqvXrpDl1q7szE,2894
|
3
3
|
nucliadb_utils/authentication.py,sha256=HTj6kFFrfdN4-DW_MNqldAPqNPdPwGHnSWl-SigiMvk,6071
|
4
|
-
nucliadb_utils/const.py,sha256=
|
4
|
+
nucliadb_utils/const.py,sha256=ug8iK4GCfHo_7bkYShgDLWvL9WYhWso8fFxIImCEoWQ,2475
|
5
5
|
nucliadb_utils/debug.py,sha256=saSfh_CDQoQl-35KCyqef5hdB_OVdrIEnlmWnZU18vg,2470
|
6
6
|
nucliadb_utils/exceptions.py,sha256=y_3wk77WLVUtdo-5FtbBsdSkCtK_DsJkdWb5BoPn3qo,1094
|
7
|
-
nucliadb_utils/featureflagging.py,sha256=
|
7
|
+
nucliadb_utils/featureflagging.py,sha256=7g_HcyiUUaEakh5fTe6q7tN7EsbcrZYZjDVntgP_FA0,2948
|
8
8
|
nucliadb_utils/grpc.py,sha256=USXwPRuCJiSyLf0JW4isIKZne6od8gM_GGLWaHHjknk,3336
|
9
9
|
nucliadb_utils/helpers.py,sha256=fOL6eImdvKO3NV39ymmo2UOCT-GAK1dfXKoMKdzdmFo,1599
|
10
10
|
nucliadb_utils/indexing.py,sha256=ELJ9bTnrxcb6tmO77HzzO1SDLPmKXTc_nBiLnJocz5I,3462
|
@@ -49,7 +49,7 @@ nucliadb_utils/tests/nats.py,sha256=lgRe6YH9LSoI7XgcyKAC2VTSAtuu8EeMve0jWWC_kOY,
|
|
49
49
|
nucliadb_utils/tests/pg.py,sha256=HBpvaNDs9T_L55tvJCJTPnsCDrB8ehI_9HRYz6SPWNE,1819
|
50
50
|
nucliadb_utils/tests/s3.py,sha256=YB8QqDaBXxyhHonEHmeBbRRDmvB7sTOaKBSi8KBGokg,2330
|
51
51
|
nucliadb_utils/tests/unit/__init__.py,sha256=itSI7dtTwFP55YMX4iK7JzdMHS5CQVUiB1XzQu4UBh8,833
|
52
|
-
nucliadb_utils/tests/unit/test_asyncio_utils.py,sha256=
|
52
|
+
nucliadb_utils/tests/unit/test_asyncio_utils.py,sha256=ETAkzQ-QLCEZW9ZtAslzoS0xRFMlN2-bqibUjJm-gRo,2359
|
53
53
|
nucliadb_utils/tests/unit/test_authentication.py,sha256=clxj4mmmUnHbUh9dvvtoA2XNruZSxRPEXD68MXXzgzU,5361
|
54
54
|
nucliadb_utils/tests/unit/test_helpers.py,sha256=w0Yxo1NteBZi_iSRVZ3vv4J-o3Z7SJIz1q6yyXGzQLg,1574
|
55
55
|
nucliadb_utils/tests/unit/test_nats.py,sha256=4lLQOucQGwL9lubTfNFqXhXtua9u4lTlWjF_lFCYORc,4436
|
@@ -63,8 +63,8 @@ nucliadb_utils/tests/unit/storages/test_aws.py,sha256=GCsB_jwCUNV3Ogt8TZZEmNKAHv
|
|
63
63
|
nucliadb_utils/tests/unit/storages/test_gcs.py,sha256=2XzJwgNpfjVGjtE-QdZhu3ayuT1EMEXINdM-_SatPCY,3554
|
64
64
|
nucliadb_utils/tests/unit/storages/test_pg.py,sha256=sJfUttMSzq8W1XYolAUcMxl_R5HcEzb5fpCklPeMJiY,17000
|
65
65
|
nucliadb_utils/tests/unit/storages/test_storage.py,sha256=VFpRq6Q6BjnIrBQCumYzR8DQUacwhxt5CzTKSlqqD24,6892
|
66
|
-
nucliadb_utils-2.45.0.
|
67
|
-
nucliadb_utils-2.45.0.
|
68
|
-
nucliadb_utils-2.45.0.
|
69
|
-
nucliadb_utils-2.45.0.
|
70
|
-
nucliadb_utils-2.45.0.
|
66
|
+
nucliadb_utils-2.45.0.post372.dist-info/METADATA,sha256=X9DUy1vVZDi_BAAvITgb9Cvt8sPuMgjLRPtxfusL38U,1978
|
67
|
+
nucliadb_utils-2.45.0.post372.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
68
|
+
nucliadb_utils-2.45.0.post372.dist-info/top_level.txt,sha256=fE3vJtALTfgh7bcAWcNhcfXkNPp_eVVpbKK-2IYua3E,15
|
69
|
+
nucliadb_utils-2.45.0.post372.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
70
|
+
nucliadb_utils-2.45.0.post372.dist-info/RECORD,,
|
File without changes
|
{nucliadb_utils-2.45.0.post371.dist-info → nucliadb_utils-2.45.0.post372.dist-info}/top_level.txt
RENAMED
File without changes
|
{nucliadb_utils-2.45.0.post371.dist-info → nucliadb_utils-2.45.0.post372.dist-info}/zip-safe
RENAMED
File without changes
|