justin13601 / ACES

ACES: Automatic Cohort Extraction System for Event-Streams
https://eventstreamaces.readthedocs.io/en/latest/
MIT License
23 stars 1 forks source link

Add predicate warning or specific error code #146

Open rvandewater opened 4 hours ago

rvandewater commented 4 hours ago

This problem was encountered with MEDS-DEV (see: https://github.com/mmcdermott/MEDS-DEV/issues/28). AUMCdb, another dataset to be added ( see https://github.com/mmcdermott/MEDS-DEV/pull/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 commented 2 hours ago

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