Hi 🙂
I have an issue to use _*GCSResult, t*_he results are not stored (but there isn't any error raised).
First, I tried to use environment variable :
from dotenv import load_dotenv
load_dotenv()
@task()
def add(x, y=1):
return x + y
with Flow("Test GCSResult", result=GCSResult(bucket='thread-prefect-flows')) as GCSResult_flow:
first_result = add(1, y=2)
second_result = add(x=first_result, y=100)
Without success, however :
from dotenv import load_dotenv
load_dotenv()
def implicit():
from google.cloud import storage
# If you don't specify credentials when constructing the client, the
# client library will look for credentials in the environment.
storage_client = storage.Client()
# Make an authenticated API request
buckets = list(storage_client.list_buckets())
print(buckets)
implicit()
works well, then I'm not sure to understand : "_Make sure your Prefect installation can
authenticate to Google's Cloud API_" (
https://docs.prefect.io/core/advanced_tutorials/using-results.html#example-running-a-flow-with-gcsresult)
Then, I tried to use Local Secret (
https://docs.prefect.io/core/advanced_tutorials/using-results.html#example-running-a-flow-with-gcsresult)
[context.secrets]
GOOGLE_APPLICATION_CREDENTIALS="auth/token.json"
GCP_CREDENTIALS="auth/token.json"
(don't know what to use between GCP_CREDENTIALS (prefect.utiliities.gcp) or GOOGLE_APPLICATION_CREDENTIALS (in the documentation of GCP), anyway I tried both and it didn't work neither.
What did I do wrong?
Please help 🙏