Skip to content

feat: make ResourceReference hashable - #1668

Merged
bcantoni merged 6 commits into
tableau:developmentfrom
jorwoods:jorwoods/hashing_reference
Nov 10, 2025
Merged

feat: make ResourceReference hashable#1668
bcantoni merged 6 commits into
tableau:developmentfrom
jorwoods:jorwoods/hashing_reference

Conversation

@jorwoods

Copy link
Copy Markdown
Contributor

Closes#1666

This allows ResourceReference to be used as a key in dicts, as well as added to sets by making it hashable. Also adds a to_reference method, while leaving the the as_reference static method in place untouched.

Closestableau#1666
This allows `ResourceReference` to be used as a key in dicts,
as well as added to sets by making it hashable. Also adds a
`to_reference` method, while leaving the the `as_reference`
static method in place untouched.
@jorwoods
jorwoodsforce-pushed the jorwoods/hashing_reference branch from a7310ee to c39ba83CompareOctober 17, 2025 20:41
@jacalata
jacalata requested a review from CopilotOctober 29, 2025 04:36

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds type safety improvements and a new to_reference() method to model classes. The changes include:

  • Adding type hints to ResourceReference class methods and properties
  • Implementing __hash__() method for ResourceReference to make it hashable
  • Adding to_reference() instance methods to UserItem, GroupItem, and GroupSetItem that convert instances to ResourceReference objects
  • Adding null safety checks in the permissions request factory to validate grantee IDs

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
tableauserverclient/models/reference_item.pyAdded type hints and __hash__() method to ResourceReference class
tableauserverclient/models/user_item.pyAdded to_reference() method with null check for converting UserItem to ResourceReference
tableauserverclient/models/group_item.pyAdded to_reference() method with null check for converting GroupItem to ResourceReference
tableauserverclient/models/groupset_item.pyAdded to_reference() method with null check for converting GroupSetItem to ResourceReference
tableauserverclient/server/request_factory.pyAdded validation to ensure grantee has an ID before adding to XML element

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadtableauserverclient/models/groupset_item.py Outdated
Comment threadtableauserverclient/models/group_item.py Outdated
@jorwoods
jorwoodsforce-pushed the jorwoods/hashing_reference branch from 3ca1445 to 9e697e4CompareOctober 29, 2025 13:47
@jorwoods

Copy link
Copy Markdown
ContributorAuthor

@bcantoni@jacalata I don't have access to fossa to see what the issue is with the license compliance check.

@bcantoni

Copy link
Copy Markdown
Contributor

@jorwoods yea you can ignore that license compliance thing. It's not a blocking check luckily.

@bcantoni
bcantoni merged commit e34cfe7 into tableau:developmentNov 10, 2025
24 of 25 checks passed
@jorwoods
jorwoods deleted the jorwoods/hashing_reference branch November 10, 2025 23:56
jacalata added a commit that referenced this pull request Feb 2, 2026
* feat: New APIs: Update multiple connections in a single workbook/datasource (#1638)
* feat: enable toggling attribute capture for a site (#1619)
* feat: support OIDC endpoints (#1630)
* feat: add WebAuthoringForFlows capability to Permission class (#1642) * feat: support collections in favorites (#1647)
* feat: Add UAT (unified access token) support to JWT login (#1671)
* feat: Update permissions_item.py --added ExtractRefresh attribute (#1617) (#1669)
* feat: make refresh consistent between endpoints (#1665)
* feat: make ResourceReference hashable (#1668) Closes#1666
* feat: delete view (#1712)
* feat: batch create schedule (#1714)
* feat: users csv import (#1409)
* feat: implement users bulk_remove
* feat: enable idp_configuration_id in bulk_add
* feat: support extensions api (#1672)
* feat: Add support for receiving "Customized Monthly" schedule intervals (#1670)
* feat: implement #816: project.get_by_id (#1736)
* fix: put special fields first (#1622) Closes#1620
* fix: virtual connections username (#1628) Closes#1626
* fix: add contentType to tags batch actions (#1643)
* fix: datasource owner/project missing parsing (#1700)
* fix: datasource description update and publish (#1682)
* fix: windows decoding error
* fix: assert on warning instead of ignore
* fix: add workbook and view setter for custom view (#1730)
* fix: handle parameters for view filters (#1633)
* fix: handle parameters for view filters Closes#1632
vchavatapalli pushed a commit to vchavatapalli/server-client-python that referenced this pull request May 5, 2026
* feat: New APIs: Update multiple connections in a single workbook/datasource (tableau#1638)
* feat: enable toggling attribute capture for a site (tableau#1619)
* feat: support OIDC endpoints (tableau#1630)
* feat: add WebAuthoringForFlows capability to Permission class (tableau#1642) * feat: support collections in favorites (tableau#1647)
* feat: Add UAT (unified access token) support to JWT login (tableau#1671)
* feat: Update permissions_item.py --added ExtractRefresh attribute (tableau#1617) (tableau#1669)
* feat: make refresh consistent between endpoints (tableau#1665)
* feat: make ResourceReference hashable (tableau#1668) Closestableau#1666
* feat: delete view (tableau#1712)
* feat: batch create schedule (tableau#1714)
* feat: users csv import (tableau#1409)
* feat: implement users bulk_remove
* feat: enable idp_configuration_id in bulk_add
* feat: support extensions api (tableau#1672)
* feat: Add support for receiving "Customized Monthly" schedule intervals (tableau#1670)
* feat: implement tableau#816: project.get_by_id (tableau#1736)
* fix: put special fields first (tableau#1622) Closestableau#1620
* fix: virtual connections username (tableau#1628) Closestableau#1626
* fix: add contentType to tags batch actions (tableau#1643)
* fix: datasource owner/project missing parsing (tableau#1700)
* fix: datasource description update and publish (tableau#1682)
* fix: windows decoding error
* fix: assert on warning instead of ignore
* fix: add workbook and view setter for custom view (tableau#1730)
* fix: handle parameters for view filters (tableau#1633)
* fix: handle parameters for view filters Closestableau#1632
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make ReferenceItem hashable

3 participants

@jorwoods@bcantoni