<#3923 [BUG] flytekit output returns FlyteLiteral ...
# flytekit
a
#3923 [BUG] flytekit output returns FlyteLiteral instead of Promise Issue created by RRap0so Describe the bug We have a task that outputs the following:
Copy code
class TaskOutput(NamedTuple):
    uri: str
    ref: str
when we do
output.ref
it returns a FlyteLiteral instead of the Promise. We believe this is due to a property set in https://github.com/flyteorg/flytekit/blob/41e21f4de56a837e09101a5cf5dd08ec4e8249df/flytekit/core/promise.py#L503 Expected behavior Flytekit Output with
ref
field should return a promise. Additional context to reproduce Running this snippet with
pyflyte
will reproduce the issue
Copy code
from typing import NamedTuple
from flytekit import task, workflow

class HelloRefOutput(NamedTuple):
  ref: str
  uri: str

@task
def hello_ref() -> HelloRefOutput:
  return HelloRefOutput(ref="hello", uri="world")

@workflow
def hello_ref_workflow() -> str:
  result = hello_ref()
  print(result) # Output(ref=Promise(node:n0.ref), uri=Promise(node:n0.uri))
  print(result.ref) # <FlyteLiteral node_id: "n0" var: "ref"> -- This should be a Promise not a FLyteLiteral
  print(result.uri) # Promise(node:n0.uri) -- OK!
Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte