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

Also validate backfill title for asset backfills #26767

Merged
merged 1 commit into from
Dec 31, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import dagster._check as check
from dagster._core.definitions.selector import PartitionsByAssetSelector, RepositorySelector
from dagster._core.definitions.utils import is_valid_title_and_reason
from dagster._core.definitions.utils import check_valid_title
from dagster._core.errors import (
DagsterError,
DagsterInvariantViolationError,
Expand Down Expand Up @@ -125,6 +125,8 @@ def create_and_launch_partition_backfill(

tags = {**tags, **graphene_info.context.get_viewer_tags()}

title = check_valid_title(backfill_params.get("title"))

if backfill_params.get("selector") is not None: # job backfill
partition_set_selector = backfill_params["selector"]
partition_set_name = partition_set_selector.get("partitionSetName")
Expand Down Expand Up @@ -169,10 +171,6 @@ def create_and_launch_partition_backfill(
"arguments"
)

is_valid_title, reason = is_valid_title_and_reason(backfill_params.get("title"))
if not is_valid_title:
raise DagsterInvariantViolationError(reason)

backfill = PartitionBackfill(
backfill_id=backfill_id,
partition_set_origin=remote_partition_set.get_remote_origin(),
Expand All @@ -183,7 +181,7 @@ def create_and_launch_partition_backfill(
tags=tags,
backfill_timestamp=backfill_timestamp,
asset_selection=asset_selection,
title=backfill_params.get("title"),
title=title,
description=backfill_params.get("description"),
)
assert_valid_job_partition_backfill(
Expand Down Expand Up @@ -231,15 +229,15 @@ def create_and_launch_partition_backfill(
)

backfill = PartitionBackfill.from_asset_partitions(
asset_graph=asset_graph,
backfill_id=backfill_id,
tags=tags,
asset_graph=asset_graph,
backfill_timestamp=backfill_timestamp,
tags=tags,
asset_selection=asset_selection,
partition_names=backfill_params.get("partitionNames"),
dynamic_partitions_store=dynamic_partitions_store,
all_partitions=backfill_params.get("allPartitions", False),
title=backfill_params.get("title"),
title=title,
description=backfill_params.get("description"),
)
assert_valid_asset_partition_backfill(
Expand Down Expand Up @@ -276,7 +274,7 @@ def create_and_launch_partition_backfill(
tags=tags,
dynamic_partitions_store=dynamic_partitions_store,
partitions_by_assets=partitions_by_assets,
title=backfill_params.get("title"),
title=title,
description=backfill_params.get("description"),
)
assert_valid_asset_partition_backfill(
Expand Down