rapidata 2.1.3__py3-none-any.whl → 2.1.4__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.
Potentially problematic release.
This version of rapidata might be problematic. Click here for more details.
- rapidata/rapidata_client/order/rapidata_order.py +15 -3
- {rapidata-2.1.3.dist-info → rapidata-2.1.4.dist-info}/METADATA +1 -1
- {rapidata-2.1.3.dist-info → rapidata-2.1.4.dist-info}/RECORD +5 -5
- {rapidata-2.1.3.dist-info → rapidata-2.1.4.dist-info}/LICENSE +0 -0
- {rapidata-2.1.3.dist-info → rapidata-2.1.4.dist-info}/WHEEL +0 -0
|
@@ -3,6 +3,7 @@ from rapidata.rapidata_client.order._rapidata_dataset import RapidataDataset
|
|
|
3
3
|
from rapidata.service.openapi_service import OpenAPIService
|
|
4
4
|
import json
|
|
5
5
|
from rapidata.api_client.exceptions import ApiException
|
|
6
|
+
from rapidata.api_client.models.order_state import OrderState
|
|
6
7
|
from typing import Optional, cast, Any
|
|
7
8
|
from rapidata.api_client.models.workflow_artifact_model import WorkflowArtifactModel
|
|
8
9
|
from tqdm import tqdm
|
|
@@ -78,6 +79,17 @@ class RapidataOrder:
|
|
|
78
79
|
if refresh_rate < 1:
|
|
79
80
|
raise ValueError("refresh_rate must be at least 1")
|
|
80
81
|
|
|
82
|
+
if self.get_status() == OrderState.CREATED:
|
|
83
|
+
raise Exception("Order has not been started yet. Please start it first.")
|
|
84
|
+
|
|
85
|
+
while self.get_status() == OrderState.SUBMITTED:
|
|
86
|
+
print(f"Order '{self.name}' is submitted and being reviewed. standby...", end="\r")
|
|
87
|
+
sleep(1)
|
|
88
|
+
|
|
89
|
+
if self.get_status() == OrderState.MANUALREVIEW:
|
|
90
|
+
raise Exception(f"Order '{self.name}' is in manual review. It might take some time to start. To speed up the process, please contact support (info@rapidata.ai).\
|
|
91
|
+
\nOnce the order has started, you can run this method again to display the progress bar.")
|
|
92
|
+
|
|
81
93
|
with tqdm(total=100, desc="Processing order", unit="%", bar_format="{desc}: {percentage:3.0f}%|{bar}| completed [{elapsed}<{remaining}, {rate_fmt}]") as pbar:
|
|
82
94
|
last_percentage = 0
|
|
83
95
|
while True:
|
|
@@ -95,7 +107,7 @@ class RapidataOrder:
|
|
|
95
107
|
if self.__workflow_id:
|
|
96
108
|
return self.__workflow_id
|
|
97
109
|
|
|
98
|
-
for _ in range(10):
|
|
110
|
+
for _ in range(10): # Try for 20 seconds to get the workflow id if workflow has not started by then, raise an exception
|
|
99
111
|
try:
|
|
100
112
|
order_result = self.__openapi_service.order_api.order_get_by_id_get(self.order_id)
|
|
101
113
|
pipeline = self.__openapi_service.pipeline_api.pipeline_id_get(order_result.pipeline_id)
|
|
@@ -104,7 +116,7 @@ class RapidataOrder:
|
|
|
104
116
|
except Exception:
|
|
105
117
|
sleep(2)
|
|
106
118
|
if not self.__workflow_id:
|
|
107
|
-
raise Exception("
|
|
119
|
+
raise Exception("Something went wrong when trying to get the order progress.")
|
|
108
120
|
return self.__workflow_id
|
|
109
121
|
|
|
110
122
|
def __get_workflow_progress(self):
|
|
@@ -131,7 +143,7 @@ class RapidataOrder:
|
|
|
131
143
|
Returns:
|
|
132
144
|
The results of the order.
|
|
133
145
|
"""
|
|
134
|
-
while self.get_status() not in [
|
|
146
|
+
while self.get_status() not in [OrderState.COMPLETED, OrderState.PAUSED, OrderState.MANUALREVIEW, OrderState.FAILED]:
|
|
135
147
|
sleep(5)
|
|
136
148
|
|
|
137
149
|
try:
|
|
@@ -368,7 +368,7 @@ rapidata/rapidata_client/metadata/_select_words_metadata.py,sha256=I4qVtCkj60ljk
|
|
|
368
368
|
rapidata/rapidata_client/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
369
369
|
rapidata/rapidata_client/order/_rapidata_dataset.py,sha256=IU0N2_LksyEDlvLq56vCkiSR45kA9I6q4pqDoEpWmMw,5240
|
|
370
370
|
rapidata/rapidata_client/order/_rapidata_order_builder.py,sha256=R4iOWy8nfIHpzqqqQcQhLgpdB8z_tUrkL2M_8rZUw9M,13121
|
|
371
|
-
rapidata/rapidata_client/order/rapidata_order.py,sha256=
|
|
371
|
+
rapidata/rapidata_client/order/rapidata_order.py,sha256=ti5fHd-KAvI_WRwe9UWF6QDx-VYzlU_Kqmi44wphJzc,6588
|
|
372
372
|
rapidata/rapidata_client/order/rapidata_order_manager.py,sha256=ZTygrv5x7dWjWxXOgFcdtyei_ap6J33SJWuWB_AwXeg,24591
|
|
373
373
|
rapidata/rapidata_client/rapidata_client.py,sha256=9SMOouDBwe-aIi9rnPtnL2vrqnlQHDKxOUpw-Eh3Fsg,1782
|
|
374
374
|
rapidata/rapidata_client/referee/__init__.py,sha256=q0Hv9nmfEpyChejtyMLT8hWKL0vTTf_UgUXPYNJ-H6M,153
|
|
@@ -417,7 +417,7 @@ rapidata/service/credential_manager.py,sha256=Of0BQs_V1T7rkrWX9groLX790nOknaARwn
|
|
|
417
417
|
rapidata/service/local_file_service.py,sha256=pgorvlWcx52Uh3cEG6VrdMK_t__7dacQ_5AnfY14BW8,877
|
|
418
418
|
rapidata/service/openapi_service.py,sha256=Z4NrAuilLlIWBdGOv6otz36tHS_vvU36w5jmvOUTmqo,3198
|
|
419
419
|
rapidata/service/token_manager.py,sha256=JZ5YbR5Di8dO3H4kK11d0kzWlrXxjgCmeNkHA4AapCM,6425
|
|
420
|
-
rapidata-2.1.
|
|
421
|
-
rapidata-2.1.
|
|
422
|
-
rapidata-2.1.
|
|
423
|
-
rapidata-2.1.
|
|
420
|
+
rapidata-2.1.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
421
|
+
rapidata-2.1.4.dist-info/METADATA,sha256=RuxhTz67gYAWeeYsbrLVADaNb91T2DMMd6RtVaeprH8,1067
|
|
422
|
+
rapidata-2.1.4.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
|
|
423
|
+
rapidata-2.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|