As discussed in  https://github.com/apache/airflow/pull/15534#discussion_r620500075, we could possibly rewrite Beam Hook to remove the need of storing state in it.
self, job_type, job_state, wait_until_finished, expected_result
    ):
        job = {"id": "id-2", "name": "name-2", "type": job_type, "currentState": job_state}
        dataflow_job = _DataflowJobsController(
            dataflow=self.mock_dataflow,
            project_number=TEST_PROJECT,
            name="name-",
            location=TEST_LOCATION,
            poll_sleep=0,
            job_id=None,
            num_retries=20,
            multiple_jobs=True,
            wait_until_finished=wait_until_finished,
        )
        result = dataflow_job._check_dataflow_job_state(job)
        assert result == expected_result
    @pytest.mark.parametrize(
        "job_state, wait_until_finished, expected_result",
        [
            
            (DataflowJobStatus.JOB_STATE_RUNNING, None, False),
            (DataflowJobStatus.JOB_STATE_RUNNING, True, False),
            (DataflowJobStatus.JOB_STATE_RUNNING, False, True),
            
            (DataflowJobStatus.JOB_STATE_PENDING, None, False),
            (DataflowJobStatus.JOB_STATE_PENDING, True, False),
            (DataflowJobStatus.JOB_STATE_PENDING, False, True),
        ],
    )
    def test_check_dataflow_job_state_without_job_type(self, job_state, wait_until_finished, expected_result):