Noticing a change in behaviour for results since u...
# ask-community
j
Noticing a change in behaviour for results since upgrading to 2.6. A task that would return an empty list now returns
None
. Wondering if this is intentional. Minimal example in the thread. Also found out I can’t downgrade from 2.6 to 2.5 because of what looks like some database migrations? Running
prefect orion database reset -y
on a database with 2.5 after upgrading to 2.6 and it fails.
πŸ‘€ 1
βœ… 1
πŸ™ 1
Copy code
@task()
def my_task():
    return []


@flow()
def my_flow():
    result = my_task()
    print(result)
In 2.5
results == []
In 2.6
results is None
z
You can downgrade your database on 2.6 then upgrade it on 2.5 and it should work. This change is definitely not intentional. I’ll look into it, thanks for pointing it out!
πŸ™ 1
j
That did the trick
thanks!
z
In the meantime you can do
@task(persist_result=True)
as well for a fix.
I reproduced successfully and will get a fix out asap.
πŸ™ 2
Ah this is a weird edge-case in Pydantic
Hey! This is fixed in 2.6.1 which is now available.
Thanks again for the report.
j
Yep. Just ran the failing test suite against the new version and it’s working!
πŸ‘ 1
My pleasure
l
Thank you for this! Was just about to post with the same issue
z
There are some additional minor fixes for results in the latest release as well πŸ™‚
πŸ‘ 1