From ef2817dcd4905fafd1468e0eedc1ee4bb7251d8e Mon Sep 17 00:00:00 2001 From: jamiedemaria Date: Fri, 13 Dec 2024 16:00:53 -0500 Subject: [PATCH] [ui] backfill preview modal - if an asset won't launch any partitions show a message instead of a spinner (#26080) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary & Motivation If you select a group of assets to backfill and select a range such that a subset of the assets have no partitions in that range, the Backfill Preview modal shows spinners for those assets For example - for the following asset graph Screenshot 2024-11-21 at 11 46 09 AM If you select only the latest hour to materialize, the daily asset will have no valid partitions to materialize (materializing today's asset isn't available until tomorrow) If you then click the "Backfill Preview" button, we show an infinite spinner for the daily asset ![image (19)](https://github.com/user-attachments/assets/ef08731b-8b8e-4f28-a53a-3eca5ad2b648) This PR adds a message when we know an asset wont have any partitions targeted by the backfill Screenshot 2024-11-21 at 11 41 39 AM ## How I Tested These Changes ## Changelog [ui] Fixed a bug in the Backfill Preview where a loading spinner would spin forever if an asset had no valid partitions targeted by the backfill --- .../packages/ui-core/src/assets/BackfillPreviewModal.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/BackfillPreviewModal.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/BackfillPreviewModal.tsx index 31607e4e01b28..f78dda46931d0 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/BackfillPreviewModal.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/BackfillPreviewModal.tsx @@ -57,7 +57,7 @@ export const BackfillPreviewModal = ({ skip: !isOpen, }, ); - const {data} = queryResult; + const {data, loading} = queryResult; const partitionsByAssetToken = useMemo(() => { return Object.fromEntries( @@ -107,8 +107,10 @@ export const BackfillPreviewModal = ({ {partitions ? ( - ) : ( + ) : loading ? ( + ) : ( + 'No partitions available to materialize' )}