hussein-awala commented on code in PR #31644:
URL: https://github.com/apache/airflow/pull/31644#discussion_r1211883082
##########
airflow/providers/google/cloud/operators/dataproc.py:
##########
@@ -164,6 +178,7 @@ def __init__(
worker_disk_type: str = "pd-standard",
worker_disk_size: int = 1024,
num_preemptible_workers: int = 0,
+ preemptibility: str = " ",
Review Comment:
Is there a typo here?
```suggestion
preemptibility: str = "",
```
And why not setting it to the default value `preemptible`?
##########
airflow/providers/google/cloud/operators/dataproc.py:
##########
@@ -178,6 +193,12 @@ def __init__(
self.num_masters = num_masters
self.num_workers = num_workers
self.num_preemptible_workers = num_preemptible_workers
+ if self.num_preemptible_workers > 0:
+ if preemptibility.lower() == "preemptible" or preemptibility == "
":
+ self.preemptibility = "PREEMPTIBLE"
+ elif preemptibility.lower() == "spot":
+ self.preemptibility = "SPOT"
Review Comment:
you can create an enum for values validation and translation, wdyt?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]