cdisc-org / cdisc-org/cdisc-rules-engine
Allow for basic SQL queries as Rule Check logic (before SQL refactor)
- Dominant language
- Python
- Stars
- 113
- Forks
- 43
- Avg merge
- 14h 51m
- Merged PRs (30d)
- 14
Description
- Add a new rule type "SQL"
- engine will do preprocessing to assign record numbers to the dataset frames for reporting
- we can make use of duckdb.query, which allows sql queries on pandas dataframe variables. (This will change in the future after the sql refactor).
- the reporting functionality will use the generated record numbers and other columns to populate the report
- Add documentation for the new rule type
- `Check` property will allow a SQL select query that returns the records that violate the rule. This will replace the business rules engine process of using a list of booleans.
- `Scope` will remain the same in terms of selecting datasets within scope, (unlike with jsonata)
- We will want to support only ANSII sql to make future compatible with other flavors of sql
Contributor guide
Research direction
Start by locating the existing rule-type handling, business rules engine boolean checks, dataset-scope processing, and reporting flow. Review how JSONata rules select datasets and how documentation describes rule types. Done means SQL rules accept ANSI SELECT checks over scoped pandas data, assign reportable record numbers, populate violations in reports, and have documented usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pandas, python, sql
- Domain
- backend, databases, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100