Fix EVALID filtering for all tables with PLT_CN column#77
Merged
Conversation
load_table() previously hardcoded EVALID filtering to only TREE and COND tables. Tables like TREE_GRM_COMPONENT were loaded unfiltered, allowing stale records from older evaluation cycles to leak through. Replace the table name allowlist with schema introspection: any table with a PLT_CN column now gets EVALID-filtered at load time. Similarly, state_filter now applies to any table with a STATECD column. Closes #76
Extend the schema introspection approach to _apply_spatial_filter(), which had the same hardcoded ["TREE", "COND"] allowlist. Now any table with a PLT_CN column gets spatial filtering when clip_by_polygon is active. Add unit tests verifying EVALID, state, and spatial filtering applies based on column presence rather than table name.
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.
Summary
load_table()hardcoded EVALID filtering to onlyTREEandCONDtables, causing tables likeTREE_GRM_COMPONENTto load unfiltered — stale records from older evaluation cycles could leak throughPLT_CNcolumn now gets EVALID-filtered at load timestate_filternow applies to any table with aSTATECDcolumn instead of onlyPLOT,COND,TREETest plan
Closes #76