Constantino Schillebeeckx
10/21/2021, 4:49 PMif not args.dry_run:
project = args.project
logger.log(SUCCESS, f"Registering flow '{flow.name}' to project '{project}'.")
logger.debug(f"Serialized flow: {json.dumps(flow.serialize(), indent=4, sort_keys=True)}")
logger.debug(f"Hashed flow: {flow.serialized_hash()}")
flow.register(
project_name=project,
idempotency_key=flow.serialized_hash(),
set_schedule_active=set_schedule_active,
)
I noticed that on back to back execution of the above script, for the same flow, to the same project, different hashes were being created. When I look at the serialized_hash
of those flows I see no difference. To confirm the serialized flows are the same, I've saved the logging output to two json files (see screenshot). The only difference I can spot is that is use indent=4
in my json.dumps however the codebase does not.Kevin Kho
Kevin Kho
Kevin Kho
Constantino Schillebeeckx
10/21/2021, 5:06 PMfreezer = freeze_time("2021-01-14 22:00:00")
freezer.start()
for flow_file, flow in flows.items():
register_flow(flow, flow_file, args)
freezer.stop()
I do this to ensure any calls to now()
evaluate to the same thing. I think this addresses your question about any dates or timesConstantino Schillebeeckx
10/21/2021, 5:07 PMflow.schedule = CronSchedule(("00 10 * * *", start_date=pendulum.datetime(2021, 1, 1, tz=tz))
Kevin Kho
Kevin Kho
Constantino Schillebeeckx
10/21/2021, 6:36 PMdavzucky
10/21/2021, 9:16 PM