Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_compiled_workflow_closure():
"""
:rtype: flytekit.models.core.compiler.CompiledWorkflowClosure
"""
cwc_pb = _compiler_pb2.CompiledWorkflowClosure()
# So that tests that use this work when run from any directory
basepath = _path.dirname(__file__)
filepath = _path.abspath(_path.join(basepath, "resources/protos", "CompiledWorkflowClosure.pb"))
with open(filepath, "rb") as fh:
cwc_pb.ParseFromString(fh.read())
return _compiler_model.CompiledWorkflowClosure.from_flyte_idl(cwc_pb)
def to_flyte_idl(self):
"""
:rtype: flyteidl.core.compiler_pb2.CompiledWorkflowClosure
"""
return _compiler_pb2.CompiledWorkflowClosure(
primary=self.primary.to_flyte_idl(),
sub_workflows=[s.to_flyte_idl() for s in self.sub_workflows],
tasks=[t.to_flyte_idl() for t in self.tasks]
)