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: adds the SerDeInfo class and tests by chalmerlowe · Pull Request #2108 · googleapis/python-bigquery

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

Conversation

@chalmerlowe

@chalmerlowe chalmerlowe commented Jan 9, 2025

Copy link
Copy Markdown
Collaborator

This PR adds the SerDeInfo (serializer/deserializer info) class and the associated tests, plus minor tweaks to support both of those changes.

Sorry, something went wrong.

Uh oh!

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

All reactions
@chalmerlowe
feat: adds SerDeInfo class and tests
840b5ea
@chalmerlowe
chalmerlowe requested review from a team and agrawal-siddharth January 9, 2025 18:51
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery API. labels Jan 9, 2025
@blunderbuss-gcf blunderbuss-gcf Bot assigned alvarowolfx Jan 9, 2025
@chalmerlowe chalmerlowe assigned tswast and Linchin and unassigned alvarowolfx Jan 9, 2025
Linchin
Linchin reviewed Jan 9, 2025
View reviewed changes
Comment thread google/cloud/bigquery/schema.py Outdated
class SerDeInfo:
"""Serializer and deserializer information.
Args:
serializationLibrary (str): Required. Specifies a fully-qualified class

@Linchin Linchin Jan 9, 2025

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.

Suggested change
serializationLibrary (str): Required. Specifies a fully-qualified class
serialization_library (str): Required. Specifies a fully-qualified class

Sorry, something went wrong.

Uh oh!

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

All reactions

@tswast tswast Jan 9, 2025

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.

+1 to transforming to PEP-8 compliant snake_case

Sorry, something went wrong.

Uh oh!

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

chalmerlowe reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@chalmerlowe chalmerlowe Jan 9, 2025

Copy link
Copy Markdown
Collaborator 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.

Resolved.

Sorry, something went wrong.

Uh oh!

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

All reactions
tswast
tswast approved these changes Jan 9, 2025
View reviewed changes

@tswast tswast 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.

Overall approach looks great. A couple nits.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread google/cloud/bigquery/schema.py Outdated
from google.cloud.bigquery import _helpers
from google.cloud.bigquery import standard_sql
from google.cloud.bigquery._helpers import (
_isinstance_or_raise,

@tswast tswast Jan 9, 2025

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: Use _helpers._isinstance_or_raise in the code instead.

Use import statements for packages and modules only, not for individual types, classes, or functions.

https://google.github.io/styleguide/pyguide.html#22-imports

Sorry, something went wrong.

Uh oh!

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

All reactions

@chalmerlowe chalmerlowe Jan 9, 2025

Copy link
Copy Markdown
Collaborator 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.

This is great feedback. I had not realized that.

Sorry, something went wrong.

Uh oh!

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

All reactions

@chalmerlowe chalmerlowe Jan 9, 2025

Copy link
Copy Markdown
Collaborator 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.

Resolved.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread google/cloud/bigquery/schema.py
Comment on lines +566 to +567
"""Serializer and deserializer information.
Args:

@tswast tswast Jan 9, 2025

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.

Might need a blank line here for the docs renderer to work?

Suggested change
"""Serializer and deserializer information.
Args:
"""Serializer and deserializer information.
Args:

Sorry, something went wrong.

Uh oh!

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

All reactions

@chalmerlowe chalmerlowe Jan 9, 2025

Copy link
Copy Markdown
Collaborator 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.

Resolved.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread google/cloud/bigquery/schema.py Outdated
class SerDeInfo:
"""Serializer and deserializer information.
Args:
serializationLibrary (str): Required. Specifies a fully-qualified class

@tswast tswast Jan 9, 2025

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.

+1 to transforming to PEP-8 compliant snake_case

Sorry, something went wrong.

Uh oh!

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

chalmerlowe reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread tests/unit/test_schema.py Outdated
Comment on lines +23 to +26
from google.cloud.bigquery.schema import (
PolicyTagList,
SerDeInfo,
)

@tswast tswast Jan 9, 2025

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.

Same nit here, regarding https://google.github.io/styleguide/pyguide.html#22-imports

Sorry, something went wrong.

Uh oh!

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

All reactions

@chalmerlowe chalmerlowe Jan 9, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Collaborator 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.

Hmm. I attempted to correct this for both PolicyTagList and SerDeInfo.
Unfortunately, there is something about how PolicyTagList is handled in our code that did not like the change and it produced several failing tests. I did not want to clutter this PR with unrelated changes, nor did I want to delay the issuance of this PR.

So I resolved this in the following way:

  • I corrected SerDeInfo and throughout the code we reference schema.SerDeInfo.
  • I left the PolicyTagList code exactly as it was found.

Sorry, something went wrong.

Uh oh!

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

tswast reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread google/cloud/bigquery/schema.py
return answer


class SerDeInfo:

@tswast tswast Jan 9, 2025

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.

Is this the name in the REST API? I'd prefer the full names rather than abbreviations, but I'm OK with this if it's to be consistent with the proto/REST API.

Sorry, something went wrong.

Uh oh!

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

Linchin reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@chalmerlowe chalmerlowe Jan 9, 2025

Copy link
Copy Markdown
Collaborator 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.

SerDeInfo is the name in the proto/REST API definitions.

Sorry, something went wrong.

Uh oh!

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

All reactions
Linchin
Linchin reviewed Jan 9, 2025
View reviewed changes
Comment thread google/cloud/bigquery/schema.py

@property
def serialization_library(self) -> Any:
"""Required. Specifies a fully-qualified class name of the serialization

@Linchin Linchin Jan 9, 2025

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: I think Required. should only apply to the init.

Sorry, something went wrong.

Uh oh!

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

All reactions

@chalmerlowe chalmerlowe Jan 10, 2025

Copy link
Copy Markdown
Collaborator 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.

As mentioned in chat, I prefer to leave this as is.

Sorry, something went wrong.

Uh oh!

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

Linchin reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Linchin
Linchin reviewed Jan 9, 2025
View reviewed changes
Comment thread google/cloud/bigquery/schema.py

@property
def name(self) -> Any:
"""Optional. Name of the SerDe. The maximum length is 256 characters."""

@Linchin Linchin Jan 9, 2025

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: similarly, we can remove Optional. here.

Sorry, something went wrong.

Uh oh!

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

All reactions

@chalmerlowe chalmerlowe Jan 10, 2025

Copy link
Copy Markdown
Collaborator 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.

As mentioned in chat, I prefer to leave this as is.

Sorry, something went wrong.

Uh oh!

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

All reactions
Linchin
Linchin reviewed Jan 9, 2025
View reviewed changes
Comment thread google/cloud/bigquery/schema.py Outdated
self._properties["serializationLibrary"] = value

@property
def name(self) -> Any:

@Linchin Linchin Jan 9, 2025

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.

Suggested change
def name(self) -> Any:
def name(self) -> Optional[str]:

Sorry, something went wrong.

Uh oh!

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

All reactions

@chalmerlowe chalmerlowe Jan 10, 2025

Copy link
Copy Markdown
Collaborator 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.

Resolved.

Sorry, something went wrong.

Uh oh!

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

All reactions
Linchin
Linchin reviewed Jan 9, 2025
View reviewed changes
Comment thread google/cloud/bigquery/schema.py Outdated
self.parameters = parameters

@property
def serialization_library(self) -> Any:

@Linchin Linchin Jan 9, 2025

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.

Suggested change
def serialization_library(self) -> Any:
def serialization_library(self) -> str:

Sorry, something went wrong.

Uh oh!

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

All reactions

@chalmerlowe chalmerlowe Jan 10, 2025

Copy link
Copy Markdown
Collaborator 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.

Resolved.

Sorry, something went wrong.

Uh oh!

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

All reactions
Linchin
Linchin reviewed Jan 9, 2025
View reviewed changes
Comment thread google/cloud/bigquery/schema.py Outdated
self._properties["name"] = value

@property
def parameters(self) -> Any:

@Linchin Linchin Jan 9, 2025

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.

Suggested change
def parameters(self) -> Any:
def parameters(self) -> Optional[dict[str, str]]:

For consistent type annotations.

Sorry, something went wrong.

Uh oh!

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

All reactions

@chalmerlowe chalmerlowe Jan 10, 2025

Copy link
Copy Markdown
Collaborator 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.

Resolved.

Sorry, something went wrong.

Uh oh!

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

All reactions
Linchin
Linchin reviewed Jan 9, 2025
View reviewed changes
Comment thread google/cloud/bigquery/schema.py Resolved

Uh oh!

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

Linchin
Linchin reviewed Jan 9, 2025
View reviewed changes
Comment thread google/cloud/bigquery/schema.py
return self._properties.get("parameters")

@parameters.setter
def parameters(self, value: Optional[dict[str, str]] = None):

@Linchin Linchin Jan 9, 2025

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.

Same as https://github.com/googleapis/python-bigquery/pull/2108/files#r1909362061

Sorry, something went wrong.

Uh oh!

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

All reactions

@chalmerlowe chalmerlowe Jan 10, 2025

Copy link
Copy Markdown
Collaborator 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.

See reply above from Python Docs about the concept of optional versus typing.Optional.

Sorry, something went wrong.

Uh oh!

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

All reactions
@chalmerlowe
cleans up type hints and some minor tweaks
de2b7a4
@Linchin
Linchin self-requested a review January 10, 2025 18:21
Linchin
Linchin approved these changes Jan 10, 2025
View reviewed changes
@chalmerlowe
chalmerlowe merged commit 62960f2 into main Jan 10, 2025
@chalmerlowe
chalmerlowe deleted the feat-b358215039-adds-serdeinfo-class branch January 10, 2025 18:22
@release-please release-please Bot mentioned this pull request Jan 10, 2025
chore(main): release 3.28.0 #2056
Merged
This was referenced Jan 21, 2025
January 20, 2025 kitta65/bq-extension-vscode#639
Closed
January 20, 2025 kitta65/prettier-plugin-bq#579
Closed
January 20, 2025 kitta65/bq2cst#468
Closed
chalmerlowe added a commit that referenced this pull request Jan 22, 2025
@chalmerlowe
feat: adds the SerDeInfo class and tests (#2108)
de45810
* feat: adds SerDeInfo class and tests

* cleans up type hints and some minor tweaks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@agrawal-siddharth agrawal-siddharth Awaiting requested review from agrawal-siddharth
2 more reviewers
@tswast tswast tswast approved these changes
@Linchin Linchin Linchin approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

@tswast tswast

@Linchin Linchin

Labels

api: bigquery Issues related to the googleapis/python-bigquery API. size: m Pull request size is medium.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

4 participants

@chalmerlowe @tswast @Linchin @alvarowolfx
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.