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

Fix models failing to load for collection not hashable TypeError #3018

Merged
merged 3 commits into from
Jan 14, 2024

Conversation

danyeaw
Copy link
Member

@danyeaw danyeaw commented Jan 13, 2024

This PR fixes a TypeError when trying to look up an attribute for a collection type caused by the class missing a __hash__ definition. This was causing some models to fail to load. I also added two tests, one to test a passing example of a attrname lookup, and a 2nd that was failing with a collection object and is now passing.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the current behavior?

Some models are failing to load

Issue Number: #2995

What is the new behavior?

Models successfully load

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the python Pull requests that update Python code label Jan 13, 2024
@danyeaw danyeaw added fix A fix for a bug and removed python Pull requests that update Python code labels Jan 13, 2024
@github-actions github-actions bot added python Pull requests that update Python code documentation labels Jan 14, 2024
@amolenaar
Copy link
Member

This looks very good. Sorry I missed this case.

@amolenaar amolenaar merged commit 945d85a into main Jan 14, 2024
20 checks passed
@amolenaar amolenaar deleted the fix-collection-not-hashable branch January 14, 2024 14:29
@danyeaw danyeaw removed python Pull requests that update Python code documentation labels Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A fix for a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants