Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backfill should fill in the right input vars #1593

Merged
merged 4 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions flytekit/clis/sdk_in_container/backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,12 @@ def backfill(
execute=execute,
parallel=parallel,
)
if entity:
console_url = remote.generate_console_url(entity)
if execute:
click.secho(f"\n Execution launched {console_url} to see execution in the console.", fg="green")
return
click.secho(f"\n Workflow registered at {console_url}", fg="green")
if dry_run:
return
console_url = remote.generate_console_url(entity)
if execute:
click.secho(f"\n Execution launched {console_url} to see execution in the console.", fg="green")
return
click.secho(f"\n Workflow registered at {console_url}", fg="green")
except StopIteration as e:
click.secho(f"{e.value}", fg="red")
7 changes: 6 additions & 1 deletion flytekit/remote/backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def create_backfill_workflow(

logging.info(f"Generating backfill from {start_date} -> {end_date}. Parallel?[{parallel}]")
wf = ImperativeWorkflow(name=f"backfill-{for_lp.name}")

input_name = schedule.kickoff_time_input_arg
date_iter = croniter(cron_schedule.schedule, start_time=start_date, ret_type=datetime)
prev_node = None
actual_start = None
Expand All @@ -79,7 +81,10 @@ def create_backfill_workflow(
if next_start_date >= end_date:
break
actual_end = next_start_date
next_node = wf.add_launch_plan(for_lp, t=next_start_date)
inputs = {}
if input_name:
inputs[input_name] = next_start_date
next_node = wf.add_launch_plan(for_lp, **inputs)
next_node = next_node.with_overrides(
name=f"b-{next_start_date}", retries=per_node_retries, timeout=per_node_timeout
)
Expand Down
1 change: 0 additions & 1 deletion tests/flytekit/unit/cli/pyflyte/test_backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def test_pyflyte_backfill(mock_remote):
"--backfill-window",
"5 day",
"daily",
"--dry-run",
],
)
assert result.exit_code == 0
Expand Down