There’s nothing fancy with the local_script_path, it just gets passed to boto3 directly here and this local script relative path should work.
hello-flow
is flow name in this example?
Kevin Kho
04/26/2022, 3:17 PM
I had no problems here:
Copy code
from prefect import Flow, task
from prefect.storage import S3
@task
def abc():
return 1
with Flow('s3 test') as flow:
abc()
flow.storage = S3(bucket="coiled-prefect", key="shoe-flow.py",
stored_as_script=True,
local_script_path="shoe-flow.py",)
flow.register("databricks")
where my file was named
shoe-flow.py
j
Jason
04/26/2022, 3:22 PM
But that's the same path as your flow? I think my issue is using a shared module. Relative pathing doesn't seem to fix it either:
Copy code
return os.path.getsize(filename)
File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/genericpath.py", line 50, in getsize
return os.stat(filename).st_size
FileNotFoundError: [Errno 2] No such file or directory: './projects/Examples/flows/hello-flow.py'
But if I run this from a parent-level notebook, it's fine:
Copy code
path.exists('./projects/Examples/flows/')
k
Kevin Kho
04/26/2022, 3:24 PM
Just confirming this is during registration time right?
Kevin Kho
04/26/2022, 3:25 PM
So you mean you are trying to register a file in another directory?
j
Jason
04/26/2022, 3:41 PM
Oh, flow-name != file-name in my example. My bad. Solved 🙂
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.