Open kokybo opened 1 year ago
Thanks for the report! I presume this is caused by visit_collection
and that we will need to add an exception for data of this type.
If you do
from prefect.utilities.annotations import quote
....
output = parse_response.submit(quote(data))
Does this work as expected?
That does not seem to work. I updated my code to be
@flow
def ingest_data():
data = download_gzip_file.submit()
output = parse_response.submit(quote(data))
return output
and added the line data = data.result()
to the parse_response task to manually await the future.
@kokybo in that case, the bytes io object is still consumed?
That is correct. The read head (object.tell()
) is still partially offset within the buffer.
I'm not sure where we are consuming it then, we'll investigate this when we get a chance or we're happy to review a contribution that resolves it :)
It looks like you could be using a yanked version of Prefect (2.82).
First check
Bug summary
I currently have a Prefect flow that downloads a large (60MB) file from a website that is gzip compressed. The file is kept in memory and passed into a task (as a BytesIO object) that decompresses the results. Prefect seems to messing with the position of the head within the BytesIO object. I have confirmed that the position is 0 when the object is created and is not 0 when it is loaded into the second task.
Reproduction
Error
Versions
Additional context
No response