Skip to content
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

Add predicate warning or specific error code #146

Closed
rvandewater opened this issue Oct 25, 2024 · 2 comments
Closed

Add predicate warning or specific error code #146

rvandewater opened this issue Oct 25, 2024 · 2 comments
Assignees
Labels
Bug Something isn't working Code Cleanliness/Ease of Development Relates to the cleanliness, organization, and overall maintainability of the codebase priority:high Things that are high priority, but do not warrant an immediate hotfix

Comments

@rvandewater
Copy link

rvandewater commented Oct 25, 2024

This problem was encountered with MEDS-DEV (see: mmcdermott/MEDS-DEV#28). AUMCdb, another dataset to be added ( see mmcdermott/MEDS-DEV#27), did not define a predicate that was in the task.yaml. This threw the slightly cryptic error code below. It might make sense to check the predicates to make sure they are defined in a certain situation.

Error executing job with overrides: ['data.shard=tuning/0']                                                                                                            	
Traceback (most recent call last):                                                                                                                                       	
File "/dhc/home/robin.vandewater/conda3/envs/MEDS-DEV/lib/python3.12/site-packages/aces/__main__.py", line 159, in main                                                  	task_cfg = config.TaskExtractorConfig.load(                                                                                                                                       	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                          	
File "/dhc/home/robin.vandewater/conda3/envs/MEDS-DEV/lib/python3.12/site-packages/aces/config.py", line 1295, in load                                                   	config_data = {k: v for k, v in p.items() if k in PlainPredicateConfig.__dataclass_fields__}                                                                                                           	^^^^^^^                                                                                                                            	
AttributeError: 'str' object has no attribute 'items'
@justin13601 justin13601 self-assigned this Oct 25, 2024
@justin13601 justin13601 added Bug Something isn't working priority:high Things that are high priority, but do not warrant an immediate hotfix Code Cleanliness/Ease of Development Relates to the cleanliness, organization, and overall maintainability of the codebase labels Oct 25, 2024
@justin13601
Copy link
Owner

Thanks! Makes sense, will add a message to check specifically for ??? since we are using that as a placeholder for undefined predicates.

justin13601 added a commit that referenced this issue Oct 25, 2024
* #141 note about memory in README

* #141 warning about memory in the docs

* #142 add warning messages if labels are all the same

* Add error message when predicates are specified using only strings (includes ??? case)

Closes #141, #142, and #146
justin13601 added a commit that referenced this issue Oct 28, 2024
…ates, as well as nested derived predicates (#145)

* Test config for derived predicates based on static predicates

* Pass in static predicates to DerivedPredicateConfig

* Logic for derived predicate between plain and static by propagating down static variable values

* Revert back to original config

* Revert DerivedPredicateConfig static attribute due to parquet issues

* Explicitly get list of static predicates from config plain predicates

* Freeze pre-commit version and update workflows

* Sort first to guarantee null timestamp rows are first per subject_id

* Warnings and error messages per #141 #142 #146  (#147)

* #141 note about memory in README

* #141 warning about memory in the docs

* #142 add warning messages if labels are all the same

* Add error message when predicates are specified using only strings (includes ??? case)

Closes #141, #142, and #146

* Add percentage for printing label distribution (code rabbit suggestion)

* Remove label distribution printing (can be done post-hoc)

* Code quality PR workflow not on all files

* Exclude test coverage for logging statements

* Update docs to clarify supported code fields

* Polish error message

* Switch to warning when no rows returned

* #94 nested derived predicates (ex: needed when creating different reference ranges for male/female)

* Added tests for derived predicates between static and plain as well as nested derived predicates
@justin13601
Copy link
Owner

Closed by #147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Code Cleanliness/Ease of Development Relates to the cleanliness, organization, and overall maintainability of the codebase priority:high Things that are high priority, but do not warrant an immediate hotfix
Projects
None yet
Development

No branches or pull requests

2 participants