Skip to content
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

feat: Adds ForeignTypeInfo class and tests #2110

Merged
merged 7 commits into from
Jan 15, 2025

Conversation

chalmerlowe
Copy link
Collaborator

This PR adds the ForeignTypeInfo class and the associated tests, plus minor tweaks to support both of those changes.

Also incorporates several small changes to correct some docstrings in other PANGEA classes for more uniformity across the PANGEA code additions.

@chalmerlowe chalmerlowe requested review from a team as code owners January 14, 2025 13:14
@chalmerlowe chalmerlowe requested a review from obada-ab January 14, 2025 13:14
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Jan 14, 2025
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Jan 14, 2025
Copy link
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

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

One nit, otherwise looking good. Thanks!

class ForeignTypeInfo:
"""Metadata about the foreign data type definition such as the system in which the
type is defined.
Args:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: needs a blank line to separate the sections

Suggested change
Args:
Args:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resolved.


def to_api_repr(self) -> dict:
"""Build an API representation of this object.
Returns:
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resolved.

def from_api_repr(cls, api_repr: Dict[str, Any]) -> "ForeignTypeInfo":
"""Factory: constructs an instance of the class (cls)
given its API representation.
Args:
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resolved.

Args:
api_repr (Dict[str, Any]):
API representation of the object to be instantiated.
Returns:
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resolved.

Copy link
Contributor

@Linchin Linchin left a comment

Choose a reason for hiding this comment

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

LGTM, just a question: do we need to add system tests for this class (to verify the api representation is correct), or it's not possible until we add more stuff?

@@ -636,10 +690,10 @@ def from_api_repr(cls, api_repr: dict) -> SerDeInfo:
"""Factory: constructs an instance of the class (cls)
given its API representation.
Args:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Args:
Args:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resolved.

@@ -636,10 +690,10 @@ def from_api_repr(cls, api_repr: dict) -> SerDeInfo:
"""Factory: constructs an instance of the class (cls)
given its API representation.
Args:
resource (Dict[str, Any]):
api_repr (Dict[str, Any]):
API representation of the object to be instantiated.
Returns:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Returns:
Returns:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resolved.

@chalmerlowe chalmerlowe merged commit 55ca63c into main Jan 15, 2025
19 checks passed
@chalmerlowe chalmerlowe deleted the feat-b358215039-adds-foreigntypeinfo-class branch January 15, 2025 04:14
chalmerlowe added a commit that referenced this pull request Jan 22, 2025
* Adds ForeignTypeInfo class and tests

* Tweak to docstring

* minor adjustment in test to enhance code coverage

* Updates spacing in docstrings

* More updates to spacing in docstrings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants