Skip to content

Commit

Permalink
Split apply total parse repo (#2226)
Browse files Browse the repository at this point in the history
* random example commit

Signed-off-by: Yun Nan Liu <[email protected]>

* random example commit

Signed-off-by: Yun Nan Liu <[email protected]>

* first commit

Signed-off-by: Yun Nan Liu <[email protected]>

* fix

Signed-off-by: Yun Nan Liu <[email protected]>

* added method to apply with user-provided parsed_repo instance

Signed-off-by: Yun Nan Liu <[email protected]>

* add apply_total_with_repo_instance to be called by apply_total

Signed-off-by: Yun Nan Liu <[email protected]>

* fix styling and arg order

Signed-off-by: Yun Nan Liu <[email protected]>

* fix lint issues

Signed-off-by: Yun Nan Liu <[email protected]>

Co-authored-by: Yun Nan Liu <[email protected]>
  • Loading branch information
mickey-liu and Yun Nan Liu authored Jan 20, 2022
1 parent feb923b commit 62fae05
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions sdk/python/feast/repo_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,13 @@ def extract_objects_for_apply_delete(project, registry, repo):
return all_to_apply, all_to_delete, views_to_delete, views_to_keep


@log_exceptions_and_usage
def apply_total(repo_config: RepoConfig, repo_path: Path, skip_source_validation: bool):

os.chdir(repo_path)
project, registry, repo, store = _prepare_registry_and_repo(repo_config, repo_path)

def apply_total_with_repo_instance(
store: FeatureStore,
project: str,
registry: Registry,
repo: RepoContents,
skip_source_validation: bool,
):
if not skip_source_validation:
data_sources = [t.batch_source for t in repo.feature_views]
# Make sure the data source used by this feature view is supported by Feast
Expand All @@ -262,6 +263,16 @@ def apply_total(repo_config: RepoConfig, repo_path: Path, skip_source_validation
log_cli_output(diff, views_to_delete, views_to_keep)


@log_exceptions_and_usage
def apply_total(repo_config: RepoConfig, repo_path: Path, skip_source_validation: bool):

os.chdir(repo_path)
project, registry, repo, store = _prepare_registry_and_repo(repo_config, repo_path)
apply_total_with_repo_instance(
store, project, registry, repo, skip_source_validation
)


def log_cli_output(diff, views_to_delete, views_to_keep):
from colorama import Fore, Style

Expand Down

0 comments on commit 62fae05

Please sign in to comment.