wmill 1.420.1__py3-none-any.whl → 1.421.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
wmill/client.py
CHANGED
@@ -358,15 +358,15 @@ class Windmill:
|
|
358
358
|
"percent": value,
|
359
359
|
"flow_job_id": flow_id or None,
|
360
360
|
},
|
361
|
-
)
|
361
|
+
)
|
362
362
|
|
363
|
-
def get_progress(self, job_id: Optional[str] = None
|
363
|
+
def get_progress(self, job_id: Optional[str] = None) -> Any:
|
364
364
|
workspace = get_workspace()
|
365
365
|
job_id = job_id or os.environ.get("WM_JOB_ID")
|
366
366
|
|
367
367
|
r = self.get(
|
368
368
|
f"/w/{workspace}/job_metrics/get_progress/{job_id}",
|
369
|
-
)
|
369
|
+
)
|
370
370
|
if r.status_code == 404:
|
371
371
|
print(f"Job {job_id} does not exist")
|
372
372
|
return None
|
@@ -472,7 +472,13 @@ class Windmill:
|
|
472
472
|
print(file_reader.read())
|
473
473
|
'''
|
474
474
|
"""
|
475
|
-
reader = S3BufferedReader(
|
475
|
+
reader = S3BufferedReader(
|
476
|
+
f"{self.workspace}",
|
477
|
+
self.client,
|
478
|
+
s3object["s3"],
|
479
|
+
s3_resource_path,
|
480
|
+
s3object["storage"] if "storage" in s3object else None,
|
481
|
+
)
|
476
482
|
return reader
|
477
483
|
|
478
484
|
def write_s3_file(
|
@@ -480,6 +486,8 @@ class Windmill:
|
|
480
486
|
s3object: S3Object | None,
|
481
487
|
file_content: BufferedReader | bytes,
|
482
488
|
s3_resource_path: str | None,
|
489
|
+
content_type: str | None,
|
490
|
+
content_disposition: str | None,
|
483
491
|
) -> S3Object:
|
484
492
|
"""
|
485
493
|
Write a file to the workspace S3 bucket
|
@@ -511,8 +519,12 @@ class Windmill:
|
|
511
519
|
query_params["file_key"] = s3object["s3"]
|
512
520
|
if s3_resource_path is not None and s3_resource_path != "":
|
513
521
|
query_params["s3_resource_path"] = s3_resource_path
|
514
|
-
if s3object is not None and
|
522
|
+
if s3object is not None and "storage" in s3object and s3object["storage"] is not None:
|
515
523
|
query_params["storage"] = s3object["storage"]
|
524
|
+
if content_type is not None:
|
525
|
+
query_params["content_type"] = content_type
|
526
|
+
if content_disposition is not None:
|
527
|
+
query_params["content_disposition"] = content_disposition
|
516
528
|
|
517
529
|
try:
|
518
530
|
# need a vanilla client b/c content-type is not application/json here
|
@@ -865,6 +877,7 @@ def set_state(value: Any) -> None:
|
|
865
877
|
"""
|
866
878
|
return _client.set_state(value)
|
867
879
|
|
880
|
+
|
868
881
|
@init_global_client
|
869
882
|
def set_progress(value: int, job_id: Optional[str] = None) -> None:
|
870
883
|
"""
|
@@ -872,6 +885,7 @@ def set_progress(value: int, job_id: Optional[str] = None) -> None:
|
|
872
885
|
"""
|
873
886
|
return _client.set_progress(value, job_id)
|
874
887
|
|
888
|
+
|
875
889
|
@init_global_client
|
876
890
|
def get_progress(job_id: Optional[str] = None) -> Any:
|
877
891
|
"""
|
@@ -1,8 +1,8 @@
|
|
1
1
|
wmill/__init__.py,sha256=nGZnQPezTdrBnBW1D0JqUtm75Gdf_xi3tAcPGwHRZ5A,46
|
2
|
-
wmill/client.py,sha256=
|
2
|
+
wmill/client.py,sha256=SHU8gxPbMV8oLuCeDua7aKNWX34KFsckfH6OaSrgPlo,34470
|
3
3
|
wmill/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26
|
4
4
|
wmill/s3_reader.py,sha256=izHlg2Xsg0Sr_LkDDEC35VuEijJcuPBDIm-xj21KsgU,1668
|
5
5
|
wmill/s3_types.py,sha256=XVjPyc5sjWesTy6nnRReojhyPgPsaT0EY3X57mWUaJ4,1173
|
6
|
-
wmill-1.
|
7
|
-
wmill-1.
|
8
|
-
wmill-1.
|
6
|
+
wmill-1.421.0.dist-info/METADATA,sha256=ewUTspvXSl741IoohYI7TEJBpof43wNzDW6KmGOlQJo,2693
|
7
|
+
wmill-1.421.0.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
8
|
+
wmill-1.421.0.dist-info/RECORD,,
|
File without changes
|