Hello Raj,
Have you tried the Bash Operator (BashOperator)
Example;
create_cluster = BashOperator(
dag=dag,
task_id='Create_cluster',
bash_command='if [ `{g_path}gcloud dataproc clusters list --region europe-west1 --project={project} | grep {cluster} | wc -l` -eq 0 ]; then `{0}`; \
else echo "cluster_exists"; fi'.format(CREATE_CLUSTER , **PARAMS),
email_on_failure=True,
trigger_rule=TriggerRule.ALL_SUCCESS
)
Shah Doulot | Data Engineer |
Data Technology & Analytic - Sky Networks
Sky UK
*
shah....@sky.uk
(
+44 207 032 2523

--
You received this message because you are subscribed to the Google Groups "cloud-composer-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
cloud-composer-di...@googlegroups.com.
To post to this group, send email to
cloud-compo...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/cloud-composer-discuss/679d3921-2e3c-46be-af82-dc7958ebf00d%40googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.
--------------------------------------------------------------------
This email is from an external source. Please do not open attachments or click links from an unknown or suspicious origin. Phishing attempts can be reported by sending them to phis...@sky.uk as attachments. Thank you
--------------------------------------------------------------------