<!--

Welcome to Apache Airflow!  For a smooth issue process, try to answer the following questions.
Don't worry if they're not all applicable; just try to include what you can :-)

If you need to include code snippets or logs, please put them in fenced code
blocks.  If they're super-long, please use the details tag like
<details><summary>super-long log</summary> lots of stuff </details>

Please delete these comment blocks before submitting the issue.

-->

**Description**

Related to the discussion here: https://github.com/apache/airflow/pull/8553#discussion_r416136954

Allow user to define expected terminal state. e.g. `JOB_STATE_CANCELLED` could be not treated as failure but expected terminal state.


<!-- A short description of your feature -->


self.log.info("On kill.")
        if self.job:
            self.hook.cancel_job(
                job_id=self.job.get("id"),
                project_id=self.job.get("projectId"),
                location=self.job.get("location"),
            )
class DataflowCreatePythonJobOperator(GoogleCloudBaseOperator):
    """
    Launching Cloud Dataflow jobs written in python.
    Note that both dataflow_default_options and options will be merged to specify pipeline
    execution parameter, and dataflow_default_options is expected to save high-level options,
    for instances, project and zone information, which apply to all dataflow operators in the DAG.
    This class is deprecated.
    Please use :class:`providers.apache.beam.operators.beam.BeamRunPythonPipelineOperator`.
    .. seealso::
        For more detail on job submission have a look at the reference:
        https://cloud.google.com/dataflow/pipelines/specifying-exec-params
    .. seealso::
        For more information on how to use this operator, take a look at the guide:
        :ref:`howto/operator:DataflowCreatePythonJobOperator`
    :param py_file: Reference to the python dataflow pipeline file.py, e.g.,
        /some/local/file/path/to/your/python/pipeline/file. (templated)
    :param job_name: The 'job_name' to use when executing the Dataflow job
        (templated). This ends up being set in the pipeline options, so any entry
        with key ``'jobName'`` or ``'job_name'`` in ``options`` will be overwritten.
    :param py_options: Additional python options, e.g., ["-m", "-v"].
    :param dataflow_default_options: Map of default job options.
    :param options: Map of job specific options.The key must be a dictionary.