Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: broken create_job method#300

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tswast merged 13 commits intogoogleapis:masterfromMaxxleLLC:bigquery_issue_297
Oct 20, 2020

Conversation

@HemangChothani
Copy link
Contributor

Fixes#297

@HemangChothaniHemangChothani requested review froma team andtswastOctober 6, 2020 13:30
@google-clagoogle-clabot added the cla: yesThis human has signed the Contributor License Agreement. labelOct 6, 2020
Copy link

@bhtuckerbhtucker left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Since the root cause of this being broken for a while was the use of autospec mocks early in the test, I wonder if it's possible to mock something a bit further along so that the test still exercises the request marshalling. Seems like we should be able to at least have coverage throughto_api_repr of theJob created by this method.

job_config
)
destination=_get_sub_prop(job_config, ["copy","destinationTable"])
destination=TableReference.from_api_repr(destination)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Would you like to guard this check withisinstance(TableReference, destination)?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I mock further in test so now it coverto_api_repr. I am not sure about the guard to check instance becausejob_config is dict and as per the example it has values in the string format.

self._configuration._properties, ["copy","sourceTable"]
)
ifsource_table:
_helpers._set_sub_prop(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

No need for this logic. We can always set thesourceTables with only a single item, but if given a job resource that has onlysourceTable we need to be able to handle that.

withload_patchasclient_method,get_config_patch:
client.create_job(job_config=job_config)
client_method.assert_called_once()
if"copy"injob_config:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ditto. I'm sure confused by this logic, but I think whatever it was meant to do is unnecessary after#323

withload_patchasclient_method,get_config_patch:
client.create_job(job_config=job_config)
client_method.assert_called_once()
# if "copy" in job_config:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Is this commented out code needed?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Sorry, my bad.

)
elif"query"injob_config:
copy_config=copy.deepcopy(job_config)
_del_sub_prop(copy_config, ["query","destinationTable"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I didn't realize we were already removing this property in past releases. We should restore this, since I don't want to break existing clients.

@tswasttswast merged commit155bacc intogoogleapis:masterOct 20, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@tswasttswasttswast approved these changes

+1 more reviewer

@bhtuckerbhtuckerbhtucker left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Job retry solution (client.create_job) is broken

3 participants

@HemangChothani@tswast@bhtucker

[8]ページ先頭

©2009-2025 Movatter.jp