airflow.hooks.subprocess¶
Module Contents¶
-
class
airflow.hooks.subprocess.SubprocessHook[source]¶ Bases:
airflow.hooks.base.BaseHookHook for running processes with the
subprocessmodule-
run_command(self, command: List[str], env: Optional[Dict[str, str]] = None, output_encoding: str = 'utf-8')[source]¶ Execute the command in a temporary directory which will be cleaned afterwards
If
envis not supplied,os.environis passed- Parameters
command -- the command to run
env -- Optional dict containing environment variables to be made available to the shell environment in which
commandwill be executed. If omitted,os.environwill be used.output_encoding -- encoding to use for decoding stdout
- Returns
namedtuplecontainingexit_codeandoutput, the last line from stderr or stdout
-