wmill 1.420.1__tar.gz → 1.421.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wmill
3
- Version: 1.420.1
3
+ Version: 1.421.0
4
4
  Summary: A client library for accessing Windmill server wrapping the Windmill client API
5
5
  Home-page: https://windmill.dev
6
6
  License: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "wmill"
3
- version = "1.420.1"
3
+ version = "1.421.0"
4
4
  description = "A client library for accessing Windmill server wrapping the Windmill client API"
5
5
  license = "Apache-2.0"
6
6
  homepage = "https://windmill.dev"
@@ -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 ) -> Any:
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(f"{self.workspace}", self.client, s3object["s3"], s3_resource_path, s3object["storage"] if "storage" in s3object else None)
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 "storage" in s3object and s3object["storage"] is not None:
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
  """
File without changes
File without changes
File without changes
File without changes
File without changes