![]() This is the main method to derive when creating an operator.Ĭontext is the same dictionary used as when rendering jinja templates. get_env ( context ) ¶īuilds the set of environment variables to be exposed for the bash command. Returns hook for running the bash command. Raise īash_task = BashOperator ( task_id = "bash_task", bash_command = "echo \" here is the message: '$message' \" ", env =, ) template_fields : Sequence = ('bash_command', 'env') ¶ template_fields_renderers ¶ template_ext : Sequence = ('.sh', '.bash') ¶ ui_color = '#f0ede4' ¶ subprocess_hook ( ) ¶ You can have all non-zero exit codes be treated as a failure by setting skip_on_exit_code=None. Will throw an, which will leave the task in skipped Task failure and zero will result in task success.Įxit code 99 (or another set in skip_on_exit_code) In general, a non-zero exit code will result in If None (default), the command is run in a temporary directory.Īirflow will evaluate the exit code of the bash command. ![]() If set to None, any non-zeroĬwd ( str | None) – Working directory to execute the command in. Skip_on_exit_code ( int | Container | None) – If task exits with this exit code, leave the task Output_encoding ( str) – Output encoding of bash command Inherited environment variables or the new variables gets appended to it If True, inherits the environment variablesįrom current passes and then environment variable passed by the user will either update the existing Of inheriting the current process environment, which is the defaultĪppend_env ( bool) – If False(default) uses the environment variables passed in env paramsĪnd does not inherit the current process environment. (templated)Įnv ( dict | None) – If env is not None, it must be a dict that defines theĮnvironment variables for the new process these are used instead Will also be pushed to an XCom when the bash command completes Parametersīash_command ( str) – The command, set of commands or reference to aīash script (must be ‘.sh’) to be executed. If BaseOperator.do_xcom_push is True, the last line written to stdout What is not part of the Public Interface of Apache Airflow?įor more information on how to use this operator, take a look at the guide:.Using Public Interface to integrate with external services and applications.Using Public Interface to extend Airflow capabilities. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |