- class airflow.hooks.subprocess.SubprocessHook¶
Hook for running processes with the
- run_command(command, env=None, output_encoding='utf-8', cwd=None)¶
Execute the command.
cwdis None, execute the command in a temporary directory which will be cleaned afterwards. If
envis not supplied,
env (dict[str, str] | None) – Optional dict containing environment variables to be made available to the shell environment in which
commandwill be executed. If omitted,
os.environwill be used. Note, that in case you have Sentry configured, original variables from the environment will also be passed to the subprocess with
SUBPROCESS_prefix. See Error Tracking for details.
output_encoding (str) – encoding to use for decoding stdout
cwd (str | None) – Working directory to run the command in. If None (default), the command is run in a temporary directory.
output, the last line from stderr or stdout
- Return type
Send SIGTERM signal to
self.sub_processif one exists.