This message was deleted.
# python
s
This message was deleted.
p
The docs states, that functions like
format
and
concat
are just wrappers around
apply
to create string outputs in an easier and more intuitive way. However, it still creates an
Output
that you need to use
apply
upon to access the actual value. The helper functions just serve the purpose of preparing the actual value in a form you need, composed of other outputs' values.
r
So is the recommendation to do something like this?
Copy code
return pulumi.Output.format("{0}", stack_ref.get_output('url')).apply(lambda x: x)
As that produces the same warning
p
No, the
myfunc
function is just right. But to print the result, you'd have to use something like
Copy code
o = myfunc()
o.apply(lambda v: print(v))
r
I had tried that earlier, though one challenge here that I didn't mention is I am doing this within an async API itself. I'm not getting the error with that code but I am also not getting the display (and I changed it to
.apply(lambda v: print("test"))
just to test and it didn't display). I can't tell if this is because the API is completing before the output is returning. I sort of want to
await
this response but not sure the way to do that?