@@ -351,26 +351,19 @@ def create(
351351 )
352352 table_deployability : t .Dict [str , bool ] = {}
353353 allow_destructive_snapshots = allow_destructive_snapshots or set ()
354+ deployability_index = deployability_index or DeployabilityIndex .all_deployable ()
354355
355356 for snapshot in target_snapshots :
356357 if not snapshot .is_model or snapshot .is_symbolic :
357358 continue
358- deployability_flags = [True ]
359- if (
360- snapshot .is_no_rebuild
361- or snapshot .is_managed
362- or (snapshot .is_model and snapshot .model .forward_only )
363- or (deployability_index and not deployability_index .is_deployable (snapshot ))
364- ):
365- deployability_flags .append (False )
366- for is_deployable in deployability_flags :
367- table = exp .to_table (
368- snapshot .table_name (is_deployable ), dialect = snapshot .model .dialect
369- )
370- snapshots_with_table_names [snapshot ].add (table .name )
371- table_deployability [table .name ] = is_deployable
372- table_schema = d .schema_ (table .db , catalog = table .catalog )
373- tables_by_gateway_and_schema [snapshot .model_gateway ][table_schema ].add (table .name )
359+ is_representative = deployability_index .is_representative (snapshot )
360+ table = exp .to_table (
361+ snapshot .table_name (is_representative ), dialect = snapshot .model .dialect
362+ )
363+ snapshots_with_table_names [snapshot ].add (table .name )
364+ table_deployability [table .name ] = is_representative
365+ table_schema = d .schema_ (table .db , catalog = table .catalog )
366+ tables_by_gateway_and_schema [snapshot .model_gateway ][table_schema ].add (table .name )
374367
375368 def _get_data_objects (
376369 schema : exp .Table ,
0 commit comments