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: add a __hash__ implementation to AccessEntry by spennymac · Pull Request #93 · googleapis/python-bigquery

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

Conversation

@spennymac

@spennymac spennymac commented May 6, 2020 •
edited by plamut
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

added __hash__ to AccessEntry

Closes #94.

Sorry, something went wrong.

Uh oh!

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

All reactions
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 6, 2020
@spennymac
feat: add a __hash__ implementation to AccessEntry
416bdca
@spennymac
spennymac force-pushed the hashable branch from 41d26f1 to 416bdca Compare May 6, 2020 11:25
@spennymac spennymac changed the title Add a __hash__ implementation to AccessEntry feat: add a __hash__ implementation to AccessEntry May 6, 2020
@spennymac

spennymac commented May 6, 2020

Copy link
Copy Markdown
Contributor Author

#94

All reactions

Sorry, something went wrong.

Uh oh!

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

@spennymac
use internal
75016c0
@IlyaFaer IlyaFaer added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 6, 2020
@IlyaFaer
IlyaFaer requested a review from shollyman May 6, 2020 14:54
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 6, 2020
plamut
plamut reviewed May 6, 2020
View reviewed changes

@plamut plamut left a comment •
edited
Loading

Uh oh!

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

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.

The __hash__() implementation looks good, let's just add a few tests covering it, e.g. making sure they can be added to (and located in) sets and dicts, equal instances having the same hash, etc.

The only potential concern is that the change makes the AccessEntry instances immutable (required with this hash implementation). I wonder if there is any user code that actually mutates these instances, as this change will break it? (cc: @shollyman)

Nevertheless, it's a simple class similar to DatasetReference, which is already hashable (and immutable), and its main purpose is just to group a few values, thus making AccessEntry immutable for hashability seems reasonable IMO.

Sorry, something went wrong.

Uh oh!

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

spennymac reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@spennymac
feat: unit tests for hashable AccessEntry
2f0cc26
@spennymac

spennymac commented May 6, 2020 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

added two tests

All reactions

Sorry, something went wrong.

Uh oh!

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

@plamut plamut added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 7, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 7, 2020
@spennymac
fix: black lint issue
7dc5aba
@plamut plamut added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 11, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 11, 2020
plamut
plamut approved these changes May 12, 2020
View reviewed changes

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

LGTM.

Will wait with merging, though, until the product gives a green light, as this is a potentially breaking change for some users.

Sorry, something went wrong.

Uh oh!

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

spennymac reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@shollyman

shollyman commented May 15, 2020

Copy link
Copy Markdown
Contributor

The pattern I can think of where mutable ACE mutations be leveraged is for code that amends an ACL via dataset update. There are cases where walking the existing ACL to amend the entries might be happening via direct mutation rather than replacing via a newly constructed ACE.

I tried to search for code examples that mutate ACEs in place, but I didn't find anything with a coarse pass. The much more common idiom is appending an entry to an existing ACL. I can't think of any existing integrations that would do this, it feels like a very specific action.

This feels relatively low risk, and not sufficient to necessitate a major rev in release to me. Peter, let's make sure we call this out clearly in the release notes however.

All reactions

Sorry, something went wrong.

Uh oh!

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

shollyman
shollyman approved these changes May 15, 2020
View reviewed changes
@plamut
Merge branch 'master' into hashable
8a7e562
@plamut plamut added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 15, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 15, 2020
@plamut
plamut merged commit 23a173b into googleapis:master May 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@shollyman shollyman shollyman approved these changes
@plamut plamut plamut approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Make AccessEntry hashable

Uh oh!

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

6 participants

@spennymac @shollyman @plamut @googlebot @IlyaFaer @yoshi-kokoro
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.