Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[logging] Clean up logging metadata abstractions (#20092)
## Summary & Motivation Clean up abstractions used in `DagsterLogManager`. The existing abstractions were more confusing than necessary, with a mix of dictionaries and NamedTuples, inconsistent proxied property access to DagsterEvent, and methods/properties that were called only once. - `DagsterLoggingMetadata` renamed to `DagsterLogHandlerMetadata`. This is because there are multiple forms of "logging metadata" in the system-- this item is specifically attached to the log manager and merged into the metadata payload for each log record. - `DagsterLogHandlerMetadata` is now a `TypedDict` instead of `NamedTuple`. It needed to be converted to a dict downstream anyway, and the presence of property fields on this was confusing, as they each had only single callsites. It is simpler to make it a dumb dictionary (which matches `DagsterLogRecordMetadata`) and compute what is needed on site. - New `DagsterLogRecordMetadata` `TypedDict` to represent the full payload attached to a log record after passing through the `DagsterLogHandler`. - Deleted `DagsterMessageProps`, which was a single-use class that just gets merged into `DagsterLogRecord`. - A few variable/property renames for clarity. ## How I Tested These Changes Existing tests. Some tests were slightly updated, but just in internal logic rather than end result, with one exception-- see inline comment on that test.
- Loading branch information