-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Fix bug in Dataflow hook when no jobs are returned #18981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1697,6 +1697,27 @@ def test_fetch_list_job_messages_responses(self): | |
| ) | ||
| assert result == ["response_1"] | ||
|
|
||
| def test_fetch_all_jobs_when_no_jobs_returned(self): | ||
| # fmt: off | ||
| ( | ||
| self.mock_dataflow | ||
| .projects.return_value | ||
| .locations.return_value | ||
| .jobs.return_value | ||
| .list.return_value | ||
| .execute.return_value | ||
| ) = {} | ||
| # fmt: on | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this what is needed here? I believe this block of code is formatted fine
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I remove turning off and on formatter it will be too long one liner
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not too long if the formatter says it's OK 🙂 |
||
|
|
||
| jobs_controller = _DataflowJobsController( | ||
| dataflow=self.mock_dataflow, | ||
| project_number=TEST_PROJECT, | ||
| location=TEST_LOCATION, | ||
| job_id=TEST_JOB_ID, | ||
| ) | ||
| result = jobs_controller._fetch_all_jobs() | ||
| assert result == [] | ||
|
|
||
| @mock.patch(DATAFLOW_STRING.format('_DataflowJobsController._fetch_list_job_messages_responses')) | ||
| def test_fetch_job_messages_by_id(self, mock_fetch_responses): | ||
| mock_fetch_responses.return_value = iter( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.