MCPcopy
hub / github.com/feast-dev/feast / apply_total_with_repo_instance

Function apply_total_with_repo_instance

sdk/python/feast/repo_operations.py:361–430  ·  view source on GitHub ↗
(
    store: FeatureStore,
    project_name: str,
    registry: BaseRegistry,
    repo: RepoContents,
    skip_source_validation: bool,
    skip_feature_view_validation: bool = False,
    no_promote: bool = False,
)

Source from the content-addressed store, hash-verified

359
360
361def apply_total_with_repo_instance(
362 store: FeatureStore,
363 project_name: str,
364 registry: BaseRegistry,
365 repo: RepoContents,
366 skip_source_validation: bool,
367 skip_feature_view_validation: bool = False,
368 no_promote: bool = False,
369):
370 if not skip_source_validation:
371 provider = store._get_provider()
372 data_sources = [
373 t.batch_source for t in repo.feature_views if t.batch_source is not None
374 ]
375 # Make sure the data source used by this feature view is supported by Feast
376 for data_source in data_sources:
377 provider.validate_data_source(store.config, data_source)
378
379 # For each object in the registry, determine whether it should be kept or deleted.
380 (
381 all_to_apply,
382 all_to_delete,
383 views_to_keep,
384 views_to_delete,
385 ) = extract_objects_for_apply_delete(project_name, registry, repo)
386
387 try:
388 if store._should_use_plan():
389 # Planning phase - compute diffs first without progress bars
390 registry_diff, infra_diff, new_infra = store.plan(
391 repo,
392 skip_feature_view_validation=skip_feature_view_validation,
393 )
394 click.echo(registry_diff.to_string())
395
396 # Only show progress bars if there are actual infrastructure changes
397 progress_ctx = None
398 if len(infra_diff.infra_object_diffs) > 0:
399 from feast.diff.apply_progress import ApplyProgressContext
400
401 progress_ctx = ApplyProgressContext()
402 progress_ctx.start_overall_progress()
403
404 # Apply phase
405 store._apply_diffs(
406 registry_diff,
407 infra_diff,
408 new_infra,
409 progress_ctx=progress_ctx,
410 no_promote=no_promote,
411 )
412 click.echo(infra_diff.to_string())
413 else:
414 # Legacy apply path - no progress bars for legacy path
415 store.apply(
416 all_to_apply,
417 objects_to_delete=all_to_delete,
418 partial=False,

Callers 1

apply_totalFunction · 0.85

Calls 12

log_infra_changesFunction · 0.85
_submit_baseline_jobsFunction · 0.85
_should_use_planMethod · 0.80
_apply_diffsMethod · 0.80
applyMethod · 0.80
_get_providerMethod · 0.45
validate_data_sourceMethod · 0.45
planMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected