feat(db): make trait_names optional in get_trait_data_pft()#4026
Open
omkarrr2533 wants to merge 1 commit into
Open
feat(db): make trait_names optional in get_trait_data_pft()#4026omkarrr2533 wants to merge 1 commit into
omkarrr2533 wants to merge 1 commit into
Conversation
S1DDHEY
approved these changes
Jun 7, 2026
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.
Makes
trait_namesoptional inget_trait_data_pft(), defaulting toNULL. When it's NULL the function returns priors for every trait associated with the PFT and derives the trait list from those, so you don't have to know the trait names up front just to get "all priors for this PFT". Passing atrait_namesvector behaves exactly as before.This is the follow-up @mdietze split out of the #3978 review. Closes #3985.
query.priorsalready supports this:trstrdefaults to NULL and theAND variables.name IN (...)clause is only added whentrstris non-NULL, so the standalone just passes NULL through and gets all priors back. No change needed there.Added a test for the NULL path (the unfiltered call has to be a superset of a single-trait filter), and removed a duplicated zero-rows test that was sitting at the end of the file. Ran the get_trait_data_pft tests locally against pecan/db:ci and the new plus the existing standalone tests pass.