Push template_id filter into SQL in get_all_resource_attributes - #286
Merged
Conversation
Co-authored-by: knoxsp <9108420+knoxsp@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] WIP: Address feedback on improving get network attributes
Push template_id filter into SQL in get_all_resource_attributes
Mar 9, 2026
knoxsp
requested changes
Mar 9, 2026
| # If a template_id is provided, retrieve the relevant attr_ids up front | ||
| # so the filter can be applied at the SQL level in each query branch below. | ||
| attr_ids = None | ||
| if template_id is not None: |
Contributor
There was a problem hiding this comment.
This will not work due to the inheritance structure in templates.
You need to call the get_template function in the template module to return the full inherited template structure, then extract the type attributes from there.
Contributor
Author
There was a problem hiding this comment.
Fixed in c798865. The direct TypeAttr/TemplateType DB query is replaced with a call to get_template(), which walks the full inheritance tree via get_types(). The attr_ids are then extracted from all templatetypes (including inherited ones) and applied as the SQL-level filter — matching the same pattern used in get_template_attributes().
Co-authored-by: knoxsp <9108420+knoxsp@users.noreply.github.com>
knoxsp
approved these changes
Mar 9, 2026
knoxsp
marked this pull request as ready for review
March 9, 2026 13:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
get_template()/get_types()TypeAttr/TemplateTypeDB query withget_template()call so inherited type attributes are included💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.