Hey! In my efforts to instrument metaflow with ope...
# ask-metaflow
l
Hey! In my efforts to instrument metaflow with openlineage: • I'm storing a value on
self.
, e.g.
self.x
• and I want to access it on
current.
, e.g.
current.x
(accessing it in the same flow run) But for the life of me, I can't find a way to do that. Could anyone help me out?
v
can you share context why you want to access it through
current
and not
self
?
f
its one of those things that isn't really documented but the @model dec kind of works like that (setting a key and access via current), this repo has a some example usage: https://github.com/outerbounds/metaflow-checkpoint
thankyou 1
would have to see how its implemented but its one way to hook into current
l
Basically: 1. In my
@openlineage
decorator, I'm creating a a. job ID for the whole flow (parent) -- if it's the
start
step b. job ID for the current step (child) c. The decorator stores these two things on
self.
-- so that this information can be accessed with in the step 2. Then within a step, I have a function called
execute_sql(query: str)
a. Under the hood, this function should grab the step/child Job ID and emit an event to the OpenLineage backend tying the SQL inputs/outputs to that job ID