@@ -261,6 +261,7 @@ def create(
261261 target_snapshots : t .Iterable [Snapshot ],
262262 snapshots : t .Dict [SnapshotId , Snapshot ],
263263 deployability_index : t .Optional [DeployabilityIndex ] = None ,
264+ on_start : t .Optional [t .Callable ] = None ,
264265 on_complete : t .Optional [t .Callable [[SnapshotInfoLike ], None ]] = None ,
265266 allow_destructive_snapshots : t .Set [str ] = set (),
266267 ) -> None :
@@ -270,6 +271,7 @@ def create(
270271 target_snapshots: Target snapshots.
271272 snapshots: Mapping of snapshot ID to snapshot.
272273 deployability_index: Determines snapshots that are deployable in the context of this creation.
274+ on_start: A callback to initialize the snapshot creation progress bar.
273275 on_complete: A callback to call on each successfully created snapshot.
274276 allow_destructive_snapshots: Set of snapshots that are allowed to have destructive schema changes.
275277 """
@@ -326,11 +328,11 @@ def _get_data_objects(schema: exp.Table, gateway: t.Optional[str] = None) -> t.S
326328 table_deployability [table_name ]
327329 )
328330 target_deployability_flags [snapshot .name ].sort ()
329- elif on_complete :
330- on_complete (snapshot )
331331
332332 if not snapshots_to_create :
333333 return
334+ if on_start :
335+ on_start (len (snapshots_to_create ))
334336 self ._create_schemas (tables_by_schema , gateway_by_schema )
335337 self ._create_snapshots (
336338 snapshots_to_create ,
@@ -350,7 +352,7 @@ def _create_snapshots(
350352 on_complete : t .Optional [t .Callable [[SnapshotInfoLike ], None ]],
351353 allow_destructive_snapshots : t .Set [str ],
352354 ) -> None :
353- """Internal method to create tables in parrallel ."""
355+ """Internal method to create tables in parallel ."""
354356 with self .concurrent_context ():
355357 concurrent_apply_to_snapshots (
356358 snapshots_to_create ,
0 commit comments