-
Notifications
You must be signed in to change notification settings - Fork 478
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
SNOW-950840 Parse new result metadata attributes for internal use #1806
SNOW-950840 Parse new result metadata attributes for internal use #1806
Conversation
7d91f84
to
add7a7d
Compare
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 on the vector side!
deb0dad
to
26729b7
Compare
ef5dc65
to
3b7a22d
Compare
is_nullable: bool, | ||
display_size: int | None = None, | ||
internal_size: int | None = None, | ||
precision: int | None = None, | ||
scale: int | None = None, |
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 there any particular reason why is_nullable moved up in order here compared to ResultMetadata. Does the ordering even matter?
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.
ordering does not matter. changes look good
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.
Yeah, I moved it up only since it doesn't have a default value. ResultMetadataV2
isn't a named tuple, so it shouldn't have any other user-visible effect.
def describe(self, *args: Any, **kwargs: Any) -> list[ResultMetadata]: | ||
def describe( | ||
self, *args: Any, **kwargs: Any | ||
) -> list[ResultMetadata | ResultMetadataV2]: |
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.
Shouldn't this be just List[ResultMetadata]?
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.
Thanks for catching this: it should be just List[ResultMetadata]
since describe only returns the old format. Same for _describe_internal
(but for the new format) in your other comment.
|
||
def _describe_internal( | ||
self, *args: Any, **kwargs: Any | ||
) -> list[ResultMetadata | ResultMetadataV2]: |
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 returning a mix of ResultMetadata and ResultMetadataV2?
I added the
NO-CHANGELOG-UPDATES
label since this change does not affect the public API of the connector. Let me know if I should instead update the changelog.Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-950840
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Created a new version of result metadata that contains new fields that have been added to the response (and are needed to support vector types in Snowpark). To avoid causing a breaking API change, this PR does not modify the existing
ResultMetadata
class (which is a named tuple so field additions could cause user-facing breakages). Instead, this change only adds parsing for a newResultMetadataV2
class that internally replaces usages ofResultMetadata
. The new metadata representation is only accessible via an internal attribute (for use by Snowpark).Longer-term, the old class should be deprecated, but, until that point, this serves as a stop-gap to unblock other work.