Jay Sundaram
04/07/2021, 8:39 PMprefect register
and you don't get any error/warning messages but only:
================= 0 registered, 1 skipped =================
Kevin Kho
prefect register
commands did you use? Is the flow simple enough to share (remove any credentials)? Did you register the flow before?Jay Sundaram
04/07/2021, 8:43 PMJay Sundaram
04/07/2021, 8:44 PMJay Sundaram
04/07/2021, 8:44 PMJay Sundaram
04/07/2021, 8:44 PMJay Sundaram
04/07/2021, 8:45 PMbucket_name = Parameter("bucket_name", default=DEFAULT_BUCKET_NAME)
Correct?Kevin Kho
flow.run()
?Jay Sundaram
04/07/2021, 8:47 PM/usr/lib/python3.8/contextlib.py:120: UserWarning: Tasks were created but not added to the flow: {<Parameter: outdir>, <Parameter: experiment_bucket_name>, <Parameter: scratch_bucket_name>}. This can occur when `Task` classes, including `Parameters`, are instantiated inside a `with flow:` block but not added to the flow either explicitly or as the input to another task. For more information, see <https://docs.prefect.io/core/advanced_tutorials/task-guide.html#adding-tasks-to-flows>.
next(self.gen)
Kevin Kho
bucket_name
is not used in a downstream task. Did you pass it to a downstream task inside your flow?Kevin Kho
outdir
, scratch_bucket_name
are the ones giving you issuesJay Sundaram
04/07/2021, 8:51 PMJay Sundaram
04/07/2021, 8:53 PMoutdir = Parameter("outdir", default=DEFAULT_OUTDIR)
I get an exception in the Flow definition block where it gets to this line:
if not os.path.exists(outdir):
pathlib.Path(outdir).mkdir(parents=True, exist_ok=True)
this is the error:
TypeError: stat: path should be string, bytes, os.PathLike or integer, not Parameter
Kevin Kho
Task
Jay Sundaram
04/07/2021, 8:55 PMKevin Kho
Kevin Kho
Kevin Kho
from prefect import task
@task
def create_dir(outdir):
if not os.path.exists(outdir):
pathlib.Path(outdir).mkdir(parents=True, exist_ok=True)
return
with Flow('test') as flow:
outdir = Parameter('outdir', default="/dir/dir")
create_dir(outdir)
Jay Sundaram
04/07/2021, 8:58 PMKevin Kho
Flows
should only contain Tasks
and Parameter
is a Task
itselfJay Sundaram
04/07/2021, 9:03 PMKevin Kho
Jay Sundaram
04/07/2021, 9:09 PMKevin Kho
Zanie
prefect register --force
?Jay Sundaram
04/08/2021, 1:57 AMJay Sundaram
04/08/2021, 2:03 PMKevin Kho
Zanie
Jay Sundaram
04/08/2021, 2:16 PM