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 display value for resource-instance-list datatypes #11641 #11642

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

jacobtylerwalls
Copy link
Member

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

Fix unreleased regression in eb85d10

Issues Solved

Closes #11641

Checklist

  • I targeted one of these branches:
    • dev/8.0.x (under development): features, bugfixes not covered below
    • dev/7.6.x (main support): regressions, crashing bugs, security issues, major bugs in new features
    • dev/6.2.x (extended support): major security issues, data loss issues
  • [unreleased] I added a changelog in arches/releases
  • I submitted a PR to arches-docs (if appropriate)
  • Unit tests pass locally with my changes
  • I added tests that prove my fix is effective or that my feature works
  • My test fails on the target branch

Ticket Background

Comment on lines -258 to +276
# TODO: remove mock, fix underlying functionality to not
# requery for Resource objects yet again in get_display_value().
with self.assertNumQueries(1):
json = ri_list.to_json(tile, node)
self.assertEqual(json, self.mock_display_value)
# Was 4, is now 3, should be 1-2 after fixing:
# https://github.com/archesproject/arches/issues/11632
with self.assertNumQueries(3):
Copy link
Member Author

Choose a reason for hiding this comment

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

This was 1 query before because I was mocking all of compile_json. But now that I'm only mocking displayname, we're hitting the extra queries mentioned in the folllow-up issue. So I left a comment that it was 4 before the commit that caused me to pop the hood on this.

Copy link
Contributor

@aarongundel aarongundel left a comment

Choose a reason for hiding this comment

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

works great! Can you get this fix into jtw/pythonic-resource-models?

@jacobtylerwalls jacobtylerwalls merged commit 06ed15a into dev/8.0.x Nov 20, 2024
7 checks passed
@jacobtylerwalls jacobtylerwalls deleted the jtw/fix-display-value-ri-list branch November 20, 2024 23:57
@jacobtylerwalls
Copy link
Member Author

Can you get this fix into jtw/pythonic-resource-models?

Done! Thanks for finding & for the speedy review.

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.

display_value sometimes missing on json representation of RI-list datatypes
2 participants