GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add session and connection properties to QueryJobConfig by tswast · Pull Request #1024 · googleapis/python-bigquery

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@tswast

@tswast tswast commented Oct 15, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes internal issue 202792922 🦕
Closes #1026
Closes #1029

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tswast
feat: add session and connection properties to QueryJobConfig
e115392
@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Oct 15, 2021
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 15, 2021
@tswast
add unit tests
e44a01a
@tswast
tswast marked this pull request as ready for review October 15, 2021 22:13
@tswast
tswast requested review from a team and stephaniewang526 October 15, 2021 22:13
plamut
plamut reviewed Oct 16, 2021
View reviewed changes

@plamut plamut left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Don't know the exact acceptance criteria for this addition, but at a face value it more or less looks good to me. Had just a few nit comments about type annotations and docstrings.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google/cloud/bigquery/job/query.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/cloud/bigquery/job/query.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/cloud/bigquery/job/base.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/cloud/bigquery/job/query.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@tswast tswast mentioned this pull request Oct 25, 2021
feat: add support for query sessions #1029
Closed
4 tasks done
@tswast
tswast requested a review from plamut October 25, 2021 22:26
tswast added 4 commits October 25, 2021 17:26
@tswast
Merge branch 'main' into b202792922-session
664d3a2
@tswast
adjust types and add versionadded
fc890b2
@tswast
add missing url
18d7321
@tswast
link to ConnectionProperty docs
70936e4
plamut
plamut reviewed Oct 26, 2021
View reviewed changes

@plamut plamut left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good, just a question about exposing SessionInfo in the generated docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google/cloud/bigquery/job/base.py Outdated
return self._properties.get("evaluationKind")


class SessionInfo(object):

@plamut plamut Oct 26, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

(nit) Explicitly inheriting from object is not needed.

Also, shouldn't we expose this class in the top level namespace? And both new classes in the reference docs?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tswast tswast Oct 26, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Added to docs via job_base.rst and query.rst. I noticed in #1023 that we'd missed a few classes, so I migrated some docs back to automodule. Even though I don't think it's the best UX to have so many classes in one page, I'd rather we not forget in the future.

Screen Shot 2021-10-26 at 9 16 56 AM

Screen Shot 2021-10-26 at 9 20 28 AM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@plamut

plamut commented Oct 26, 2021

Copy link
Copy Markdown
Contributor

#1029 is not that much different, the differences are the following:

  • No SessionInfo class, session_id is exposed directly on the QueryJob instance (similarly to query stats, e.g. estimated_bytes_processed).
  • Accepting None as a valid value, the new properties has mostly been marked as Optional[...]
  • Contains a fix for the script_options's docstring.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tswast
add resource classes to root module
210f2bd
@tswast

tswast commented Oct 26, 2021

Copy link
Copy Markdown
Contributor Author

No SessionInfo class, session_id is exposed directly on the QueryJob instance (similarly to query stats, e.g. estimated_bytes_processed).

That makes sense, but I'd rather stick with a close mapping to the actual REST API. I suspect it's a class because they might want to add a lot more session-related stats in the future.

Accepting None as a valid value, the new properties has mostly been marked as Optional[...]

The docs at https://cloud.google.com/bigquery/docs/reference/rest/v2/ConnectionProperty don't appear to indicate that key/value are optional. I'm not sure how useful a connection property will be without a key/value. Certainly the two existing ones require something for both.

Contains a fix for the script_options's docstring.

Good catch. Done!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tswast
tswast requested a review from plamut October 26, 2021 14:51
@tswast
Merge branch 'main' into b202792922-session
1522061
plamut
plamut approved these changes Oct 27, 2021
View reviewed changes
@plamut
plamut merged commit e4c94f4 into main Oct 27, 2021
@plamut
plamut deleted the b202792922-session branch October 27, 2021 07:12
@tswast tswast mentioned this pull request Nov 22, 2021
feat: add api_method parameter to Client.query to select INSERT or QUERY API #967
Merged
4 tasks done
@release-please release-please Bot mentioned this pull request Jan 4, 2022
chore(main): release python-bigquery 1.27.1 #1097
Closed
abdelmegahedgoogle pushed a commit to abdelmegahedgoogle/python-bigquery that referenced this pull request Apr 17, 2023
@tswast @abdelmegahedgoogle
feat: add session and connection properties to QueryJobConfig (google…
b78d6cb
…apis#1024)

* feat: add session and connection properties to QueryJobConfig

* add unit tests

* adjust types and add versionadded

* add missing url

* link to ConnectionProperty docs

* add resource classes to root module
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@stephaniewang526 stephaniewang526 Awaiting requested review from stephaniewang526
1 more reviewer
@plamut plamut plamut approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: bigquery Issues related to the googleapis/python-bigquery API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add session support

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@tswast @plamut
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.