plain-carpenter-99052
01/18/2024, 10:33 AMfrom metaflow import Flow, FlowSpec, get_namespace, namespace, step, current
def get_production_runs(flow_id):
current_namespace = get_namespace()
namespace(None)
runs = Flow(flow_id).runs("runtime:step-functions")
namespace(current_namespace)
return runs
class PredictFlow(FlowSpec):
@step
def start(self):
training_flow = get_production_runs("TrainingFlow")
@step
def end(self):
pass
if __name__ == "__main__":
PredictFlow()
snippet B
from metaflow import Flow, FlowSpec, namespace, step, get_namespace
class PredictFlow(FlowSpec):
@step
def start(self):
if get_namespace().startwith(f"production:metaflow"):
namespace('my_namespace')
training_flow = Flow("TrainingFlow").runs()
@step
def end(self):
pass
My guess is snippet B
Thx for any advice!
Deployment : AWS step-functions
Metaflow : metaflow==2.10.7