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

Make table instances created with the same arguments evaluate equal to each other #854

Closed
akettmann-e24 opened this issue Aug 5, 2021 · 2 comments · Fixed by #867
Closed
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@akettmann-e24
Copy link

Two table objects with the same arguments do not evaluate as equal. This makes unit testing and comparing calls to Client.insert_rows more complicated than necessary.

Environment details

  • OS type and version: Fedora 32
  • Python version: 3.9.5
  • pip version: 21.1.3
  • google-cloud-bigquery version: 2.23.2

Steps to reproduce

  1. Create table with set of args
  2. Create separate instance of table with same set of args
  3. Test equality t1 == t2
  4. returns false

Code example

from google.cloud.bigquery import Table
t1 = Table('project.dataset.table')
t2 = Table('project.dataset.table')
t1 == t2
# returns: False
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Aug 5, 2021
@plamut
Copy link
Contributor

plamut commented Aug 6, 2021

That sounds reasonable, we could indeed implement custom comparison logic for Table classes.

(treating this as a feature request rather than a bug)

@plamut plamut added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Aug 6, 2021
@plamut plamut self-assigned this Aug 6, 2021
@plamut plamut changed the title Table instances created with the same arguments do NOT evaluate as equals Make table instances created with the same arguments evaluate equal to each other Aug 6, 2021
@akettmann-e24
Copy link
Author

Makes sense to me! Wasn't sure which way I should put it in, but I figured if I am hitting it I am likely not the only one.

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. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants