hello all! i'm experiencing a strange error when t...
# prefect-server
n
hello all! i'm experiencing a strange error when trying to set a schedule for a flow: i'm setting up my workflow as follows:
Copy code
def main():
    # Schedule for every day @ 4AM ET / 9AM UTC
    today = datetime.now(timezone.utc)
    start = datetime(
        int(today.year),
        int(today.month),
        int(today.day+1),
        hour=int(START_TIME.hour),
        minute=int(START_TIME.minute),
        tzinfo=timezone.utc
    )
    schedule = IntervalClock(
        start_date=start,
        interval=timedelta(days=1),
    )

    with Flow(schedule=schedule):
.........
when i try to register this flow, i get the following:
Copy code
<snip>
TypeError: not all arguments converted during string formatting

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "register_flows.py", line 7, in <module>
    dev_flow.register()
  File "/usr/local/bin/ddiqa-aws/ddiqa_aws/flows/dev_flow.py", line 234, in register
    main()
  File "/usr/local/bin/ddiqa-aws/ddiqa_aws/flows/dev_flow.py", line 227, in main
    flow.register(
  File "/home/nlambeth/.local/lib/python3.8/site-packages/prefect/core/flow.py", line 1668, in register
    registered_flow = client.register(
  File "/home/nlambeth/.local/lib/python3.8/site-packages/prefect/client/client.py", line 802, in register
    raise ValueError(
ValueError: Flow could not be deserialized successfully. Error was: TypeError('not all arguments converted during string formatting')
this flow registers and runs 100% ok if i don't pass
schedule
in to Flow(). i can't seem to find any relevant bug reports out there.
a
As an aside, if you intend to schedule the flow to run daily at a particular hour and minute, perhaps a
CronSchedule
would be simpler?
n
definitely; that's my next approach
i can confirm i get the same error whether i set
schedule
to either a
CronClock
or
IntervalClock
doh! this is a bonehead move on my part. i need to do
schedule = Schedule(clocks=[etc])
before passing it into Flow. i'll leave this here for anyone that makes the same mistake!