Augie Palacios
02/27/2023, 9:18 PMJay Ganbat
02/27/2023, 11:24 PMAugie Palacios
02/27/2023, 11:26 PMTaoufik Dachraoui
02/28/2023, 11:54 AMDan Rammer (hamersaw)
02/28/2023, 1:03 PMMelody Lui
02/28/2023, 10:11 PMfrom flytekit import reference_launch_plan
?Jay Ganbat
02/28/2023, 10:40 PMfrom flytekit.core.launch_plan import LaunchPlan, reference_launch_plan
im doing it like aboveTaoufik Dachraoui
03/04/2023, 7:14 PMAugie Palacios
03/06/2023, 7:23 PMReferenceLaunchPlan
object. If I call the execute()
method on that object I get an Exception "Remote reference entities cannot be run locally. You must mock this out."
. What is the correct way to finally execute the lp?Jay Ganbat
03/06/2023, 7:28 PMAugie Palacios
03/06/2023, 7:32 PMtest_lp = reference_launch_plan(
project="test",
domain="development",
name="test.workflows.thing.my_workflow",
version="1"
)
thing = test_lp(
my_test_func(**kwargs)
)
test_data = thing.execute()
with the execute function causing the errorJay Ganbat
03/06/2023, 7:37 PM@reference_launch_plan(
project=my_project, domain=my_domain, name=my_ref_wf_name, version=version
)
def my_wf(<necessary parameters of the ref LP>
) -> <return type>:
...
Augie Palacios
03/06/2023, 7:39 PMJay Ganbat
03/06/2023, 10:24 PMversion=version
? i shoudlve said `version=<your ref LP version as string>Augie Palacios
03/06/2023, 10:31 PM0.7.7
for example and then my reference launch plan is: @reference_launch_plan(project="test", domain="development", name="<http://test.workflows.thing.my|test.workflows.thing.my>_workflow", version="1")
. When I tried to serialize and register the workflow it was looking for ``test.workflows.thing.my_workflow`` version 0.7.7
instead of version 1
that I defined in the decorator@workflow
def workflow(
city: str,
first_name: str,
last_name: str,
) -> str:
call_to_reference_decorator(
person_spec={
"first_name": f"{first_name}",
"last_name": f"{last_name}",
},
location={
"city": f"{city}",
"country": "USA",
},
)
return 'Done'
for whatever reason if I just passed in first_name
or other vars as the raw variables and not string formatted I got a Binding issueJay Ganbat
03/06/2023, 10:34 PM@reference_launch_plan(project="some_other_test_project", domain="development", name="<http://test.workflows.thing.my|test.workflows.thing.my>_workflow", version="1")
Augie Palacios
03/06/2023, 10:36 PM@reference_launch_plan(project="test", domain="development", name="test.workflows.thing.my_workflow", version="1")
def call_to_reference_decorator(
first_name: str,
last_name: str,
city: str,
) -> str:
return str
doing my best to simplify my current function since it takes many vars and objects as inputs...hopefully its still making senseJay Ganbat
03/06/2023, 10:38 PMAugie Palacios
03/06/2023, 10:39 PMJay Ganbat
03/06/2023, 10:42 PMcall_to_reference_decorator
need to have a matching signature as your reference workflow or launchplan, in names and parameter and output tyoesAugie Palacios
03/06/2023, 10:44 PMreturn str
?Jay Ganbat
03/06/2023, 10:45 PM…
so remote return str
ellipsis
haha not 3 dots 🤣Augie Palacios
03/06/2023, 10:48 PMTypedDict
from the typing
libraryAssertionError: Failed to Bind variable dataset_spec for function bulk_inference.workflows.inference.run_on_dataset.
lp_func(dataset_spec={"dataset_id": dataset_id})
for whatever reason, but works if I string format the dataset_id 🤷Jay Ganbat
03/06/2023, 10:57 PMAugie Palacios
03/06/2023, 10:59 PM