Repository navigation
Send task inlets and outlets as JSON lists in OpenLineage facet - #74666
Conversation
kacpermuda
left a comment
There was a problem hiding this comment.
A solid PR, solving one of the issues OL consumers are facing. It's not introducing any breaking changes, current inlets/outlets keys are untouched, but consumers can get the same information in a properly encoded version by using the _list suffixed keys. Good work !
|
Can we also please make sure to adjust openlineage system tests files by adding these new keys where they belong? Look at |
c706677 to
e31f175
Compare
Good call, added |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Description
AirflowRunFacet.tasknow carries two new keys,inlets_listandoutlets_list, with the same assets asinlets/outletsbut as real JSON lists instead of a Pythonstr(list)repr. Runtime-emitted asset events (fromoutlet_events) are included, same as inoutlets.Values in
extrathat JSON can't encode are cast withstr()(e.g.Decimal("10")->"10", a date ->"2026-01-02"), and astrEnum uri is sent as its value. If conversion still fails, a warning is logged and the key is omitted, so the rest of the facet is unaffected.The existing
inlets/outletsstring keys are unchanged, so current consumers keep working.Before / after for one outlet whose
extrahas a quoted etag and a bool:Motivation
inlets/outletsare sent as a Python repr string, so consumers have to parse Python literal syntax to get the asset uris. Since #65727 added runtime asset events,extraroutinely holds free-form user payloads, and values like a string containing"or',True,NoneorDecimal(...)make the usual "swap quotes and parse as JSON" approach fail for the whole list. A consumer then silently drops every outlet of the task. Sending a real list removes the need to parse a repr at all.related: #65727
Testing
extrawith quotes, apostrophe,True,None-> preserved as-is inoutlets_listDecimal/dateinextra-> stringified, alias events keepsource_aliasAirflowRunFacetthrough the OpenLineage client'sSerde.to_jsonand confirmedoutlets_listcomes out as a JSON array with all values intactNotes for Reviewer
InfoJsonEncodable.__init__, because_cast_basic_typesturns any list into a repr string. Happy to move this into a generic "raw fields" option on the base class if preferred.*_list) is open to suggestions.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5.5) following the guidelines