# prefect-community


10/03/2022, 11:58 PM
Noob question Sorry to post this here, but since its part of the Prefect docs it seems appropriate. I'm doing this tutorial from the blog Workflow without DAGs, a little confused by an error from the first code snippet
If I leave
in the code, it fails with error:
Copy code
letter = get_letter().result()
AttributeError: 'str' object has no attribute 'result'
But remove the
bit and I get success:
Copy code
poetry run python src/quickstart/
16:48:31.385 | INFO    | prefect.engine - Created flow run 'jasper-uakari' for flow 'Result Flow'
16:48:31.454 | INFO    | Flow run 'jasper-uakari' - Created task run 'Get a letter-c414aff6-0' for task 'Get a letter'
16:48:31.454 | INFO    | Flow run 'jasper-uakari' - Executing 'Get a letter-c414aff6-0' immediately...
16:48:31.468 | INFO    | Task run 'Get a letter-c414aff6-0' - A
16:48:31.478 | INFO    | Task run 'Get a letter-c414aff6-0' - Finished in state Completed()
16:48:31.478 | INFO    | Flow run 'jasper-uakari' - You got: A
16:48:31.488 | INFO    | Flow run 'jasper-uakari' - Finished in state Completed('All states completed.')
The poetry environment is:
Copy code
 python = "^3.10"
 prefect = "^2.4.5"
 greenlet = "^1.1.3"
❤️ 1

Matt Conger

10/04/2022, 12:35 AM
Hey Merlin, results are now directly returned when calling a flow or task. This means that the .result() is no longer needed with the newest versions of Prefect 2. I've included some documentation explaining below.
upvote 1
❤️ 1


10/04/2022, 12:49 AM
ohhhh, thats great!! I was going to complain about having to do .result. Thanks for keeping Prefect out of the way, its great!
🙌 1

Jeff Hale

10/04/2022, 2:18 PM
Just note that that tutorial is for a 2.0 beta version and 2.4.5 is the latest version, so there have been a number of changes. 🙂
🙌 1