:wave: Hi, I'm looking for some advice on `@flow(r...
# ask-community
p
👋 Hi, I'm looking for some advice on
@flow(result_storage=....)
as I try to upgrade from v2 to v3. So in order to pass in a
WritableFileSystem
I have to have already run
.save
on this object in order to get a
_document_block_id
(see flows.py) otherwise you get a:
Copy code
TypeError: Result storage configuration must be persisted server-side. Please call `.save()` on your block before passing it in.
However this is a bit funny. Since the
@flow
decorator is running at import time, it means I have to run network calls during imports?? This is also strange if I just run the flow locally as well, particularly if I'm using a
LocalFileSystem()
block. Furthermore I'm finding issues with pytest where during test collection, it could reach out to Prefect Cloud before I have the chance in a fixture to run
with prefect_test_harness()
as suggested by https://docs.prefect.io/v3/develop/test-workflows and on CI where we don't use Prefect Cloud credentials I end up with:
Copy code
E   RuntimeError: Timed out while attempting to connect to ephemeral Prefect API server.
I'm unsure if I'm just way off in expected use case, but this all work in v2 - and if I just drop the check for
_document_block_id
I can get lots running. Thanks in advance!