- Notifications
You must be signed in to change notification settings - Fork321
feat: addedconnection_properties andcreate_session in load job#1509
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
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
3 commits Select commitHold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -51,6 +51,7 @@ docs.metadata | ||
| # Virtual environment | ||
| env/ | ||
| venv/ | ||
| # Test logs | ||
| coverage.xml | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -28,6 +28,7 @@ | ||
| from google.cloud.bigquery.job.base import _AsyncJob | ||
| from google.cloud.bigquery.job.base import _JobConfig | ||
| from google.cloud.bigquery.job.base import _JobReference | ||
| from google.cloud.bigquery.query import ConnectionProperty | ||
| class LoadJobConfig(_JobConfig): | ||
| @@ -120,6 +121,25 @@ def clustering_fields(self, value): | ||
| else: | ||
| self._del_sub_prop("clustering") | ||
| @property | ||
| def connection_properties(self) -> List[ConnectionProperty]: | ||
| """Connection properties. | ||
| See | ||
| https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationLoad.FIELDS.connection_properties | ||
| .. versionadded:: 3.7.0 | ||
| """ | ||
| resource = self._get_sub_prop("connectionProperties", []) | ||
| return [ConnectionProperty.from_api_repr(prop) for prop in resource] | ||
| @connection_properties.setter | ||
| def connection_properties(self, value: Iterable[ConnectionProperty]): | ||
| self._set_sub_prop( | ||
| "connectionProperties", | ||
| [prop.to_api_repr() for prop in value], | ||
| ) | ||
| @property | ||
| def create_disposition(self): | ||
| """Optional[google.cloud.bigquery.job.CreateDisposition]: Specifies behavior | ||
| @@ -134,6 +154,27 @@ def create_disposition(self): | ||
| def create_disposition(self, value): | ||
| self._set_sub_prop("createDisposition", value) | ||
| @property | ||
| def create_session(self) -> Optional[bool]: | ||
| """[Preview] If :data:`True`, creates a new session, where | ||
| :attr:`~google.cloud.bigquery.job.LoadJob.session_info` will contain a | ||
| random server generated session id. | ||
| If :data:`False`, runs load job with an existing ``session_id`` passed in | ||
| :attr:`~google.cloud.bigquery.job.LoadJobConfig.connection_properties`, | ||
| otherwise runs load job in non-session mode. | ||
| See | ||
| https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationLoad.FIELDS.create_session | ||
| .. versionadded:: 3.7.0 | ||
| """ | ||
| return self._get_sub_prop("createSession") | ||
| @create_session.setter | ||
| def create_session(self, value: Optional[bool]): | ||
| self._set_sub_prop("createSession", value) | ||
| @property | ||
| def decimal_target_types(self) -> Optional[FrozenSet[str]]: | ||
| """Possible SQL data types to which the source decimal values are converted. | ||
| @@ -629,13 +670,31 @@ def autodetect(self): | ||
| """ | ||
| return self._configuration.autodetect | ||
| @property | ||
| def connection_properties(self) -> List[ConnectionProperty]: | ||
| """See | ||
| :attr:`google.cloud.bigquery.job.LoadJobConfig.connection_properties`. | ||
| .. versionadded:: 3.7.0 | ||
| """ | ||
| return self._configuration.connection_properties | ||
tswast marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| @property | ||
| def create_disposition(self): | ||
| """See | ||
| :attr:`google.cloud.bigquery.job.LoadJobConfig.create_disposition`. | ||
| """ | ||
| return self._configuration.create_disposition | ||
| @property | ||
| def create_session(self) -> Optional[bool]: | ||
| """See | ||
| :attr:`google.cloud.bigquery.job.LoadJobConfig.create_session`. | ||
| .. versionadded:: 3.7.0 | ||
| """ | ||
| return self._configuration.create_session | ||
tswast marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| @property | ||
| def encoding(self): | ||
| """See | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
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.