Updates to event dataclasses#45
Updates to event dataclasses#45jlumpe wants to merge 11 commits intosnakemake:feat-event-dataclassesfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Also updated |
|
Thanks! I've been working on integrating the event data classes upstream, and I'm wondering if it's worth keeping the log event enum? I'm thinking Handlers can just check the instance of the event. But I'm not sure if I'm missing something or changing for the sake of changing. |
|
I think the enum is useful. In my specific case I'm using it to define the associated type when converting to/from JSON, I could see it being used in other similar ways. With the current setup it is also necessary to determine how to extract the data from a |
|
Looks good @jlumpe. I will try to review this ASAP. I know there are some fields I want to add to JobInfo to better handle retries/attempts (cademirch/snkmt#6) |
|
Sorry, pushed the changes I have so far but they're still not quite ready. Here's a summary of what's included: Summary of changes
Potential issues
Still to do
Other thoughtsCurrently the only use of the |
|
It's not ready for a PR yet, but check out this commit for how the new dataclasses would be used in the main library. |
3786656 to
d71315c
Compare
|
This should be ready to merge. I've gone ahead and renamed certain attributes for consistency, as was already done with |
|
Also made the conversion functions return |
This isn't quite finished and I was planning on submitting a pull request directly to main after the base one had been merged, but I'm adding it now for the purposes of discussion.
LogEventDatabase class.LogEventenum values andLogEventDatasubclasses (LogEventData.eventclass attribute, andLOG_EVENT_CLASSESglobal var).from_record()class method that just inspects the dataclass fields:from_record()that was different than the dataclass field default.Still to be done:
data_from_record()function which dispatches to proper subclass based onrecord.event.from_record()class method be made private in this case?to_extra()method, which converts to the dict to be passed as theextraargument to a logging function.LogRecordinstance.