Skip to content

Conversation

@stefanvanburen
Copy link
Member

Fixes #353.

@stefanvanburen stefanvanburen merged commit 6b59c4e into main Aug 25, 2025
13 checks passed
@stefanvanburen stefanvanburen deleted the svanburen/fix-instance-check branch August 25, 2025 17:04

def cel_unique(val: celtypes.Value) -> celpy.Result:
if not isinstance(val, celtypes.ListType):
if not isinstance(val, celtypes.ListType) and not isinstance(val, list):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think not isinstance(val, (celtypes.ListType, list)) would have worked here.

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, yeah, that's a little nicer. feel free to PR!

Copy link
Contributor

Choose a reason for hiding this comment

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

Happy to. #357 is up if you'd like to take a look.

engnatha added a commit to engnatha/protovalidate-python that referenced this pull request Aug 25, 2025
The fix in bufbuild#354 had an extra `isinstance` call. The second argument can be a tuple of types, so this reduces it back down to one call.
stefanvanburen pushed a commit that referenced this pull request Aug 25, 2025
The fix in #354 used two `isinstance` calls. The second argument to
`isinstance` allows for a tuple of types, so this PR reduces the check
back down to 1 call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] unique fails when called on a concatenated list

4 participants