-
Notifications
You must be signed in to change notification settings - Fork 9
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
Implement query AST, with a new function, StringConcat. #808
Merged
apognu
merged 9 commits into
feat/sanctions-in-iterations
from
feat/sanctions/configure-queries
Jan 31, 2025
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
fdd5667
Implement query AST, with a new function, StringConcat.
apognu f1895f1
Added a few unit tests for the evaluate sanction check function.
apognu d314156
Add on delete cascade between sanction check configs and scenario ite…
apognu 4039974
Mark the trigger rule of a sanction check as non-null, only its updat…
apognu ed784a0
Edit scenario validation to include sanction check config.
apognu a8e9f1d
StringConcat node: skip nil values.
apognu 88d5ccb
StringConcat node: error out when all values are nil.
apognu 1938ad8
Bump migration version.
apognu 520c4f9
Fixed tests from feature branch changes.
apognu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
14 changes: 14 additions & 0 deletions
14
repositories/migrations/20250130150000_add_sanctions_query_builder.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-- +goose Up | ||
|
||
alter table sanction_check_configs add column query jsonb not null default '{}'; | ||
|
||
alter table sanction_check_configs | ||
drop constraint fk_scenario_iteration, | ||
add constraint fk_scenario_iteration | ||
foreign key (scenario_iteration_id) | ||
references scenario_iterations (id) | ||
on delete cascade; | ||
|
||
-- +goose Down | ||
|
||
alter table sanction_check_configs drop column query; |
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I understand correctly this is the "name" on which we filter on yente, would it make sense for future compatibility to also store the entity (here, default to "thing") on which we filter ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it doesn't map directly to OpenSanctions queries, those are managed separatly in a model specific to the provider. This is purely our own internal representation of the query set up from the UI.
This is where we would put
Label
and a genericAttributes
if we decide to keep them in the UI.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, got it. So it's "name" as in the design where we filter on the "name" (and optionally other things)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It translates, on execution, to an OpenSanctions query which is stored in the
sanction_checks
table.