<#1252 Add python interface to FlyteWorkflow> Pull...
# flyte-github
c
#1252 Add python interface to FlyteWorkflow Pull request opened by pingsutw Signed-off-by: Kevin Su pingsutw@apache.org TL;DR fixes https://flyte-org.slack.com/archives/CP2HDHKE1/p1676916832851009?thread_ts=1676907633.986649&cid=CP2HDHKE1 Failed to run LP when the workflow type is FlyteWorklfow because there is no python_interface in the
Flyteworkflow
.
Copy code
"/Users/ematus/test_flyte/flyte_remote.py", line 16, in <module>
    execution = remote.execute(lp, inputs={}, execution_name="test lanuch plan", wait=False) #fails here 'NoneType' object has no attribute 'inputs'
  File "/opt/homebrew/lib/python3.9/site-packages/flytekit/remote/remote.py", line 1107, in execute
    return self.execute_local_launch_plan(
  File "/opt/homebrew/lib/python3.9/site-packages/flytekit/remote/remote.py", line 1360, in execute_local_launch_plan
    type_hints=entity.python_interface.inputs,
AttributeError: 'NoneType' object has no attribute 'inputs'
we can use
TypeEngine.guess_python_type
to create
python_interface
by ourself. Type • Bug Fix • Feature • Plugin Are all requirements met? • Code completed • Smoke tested • Unit tests added • Code documentation added • Any pending items have an associated Issue Complete description from flytekit import LaunchPlan from flytekit.remote import FlyteRemote from flytekit.configuration import Config remote = FlyteRemote( config=Config.auto("/Users/kevin/.flyte/config-remote.yaml"), default_project="flytesnacks", default_domain="development", ) wf = remote.fetch_workflow(name="development.workflow.test.wf", version="8e689bb91ccbbfe63ca8112b527d0962", project="flytesnacks", domain="development") lp = LaunchPlan.get_or_create(wf) execution = remote.execute(lp, inputs={}, wait=False) #fails here 'NoneType' object has no attribute 'inputs' Tracking Issue flyteorg/flyte#2977 Follow-up issue NA flyteorg/flytekit