Skip to content

Commit

Permalink
Added --skip-source-validation flag to feast apply (feast-dev#1702)
Browse files Browse the repository at this point in the history
* Added --validate-off flag to feast apply

Signed-off-by: David Y Liu <[email protected]>

* changed flag name to be more descriptive

Signed-off-by: David Y Liu <[email protected]>
Signed-off-by: CS <[email protected]>
  • Loading branch information
mavysavydav authored and SourdoughCat committed Jul 16, 2021
1 parent 28b931a commit c5adb6a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 7 additions & 2 deletions sdk/python/feast/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,21 @@ def feature_view_list(ctx: click.Context):


@cli.command("apply", cls=NoOptionDefaultFormat)
@click.option(
"--skip-source-validation",
is_flag=True,
help="Don't validate the data sources by checking for that the tables exist.",
)
@click.pass_context
def apply_total_command(ctx: click.Context):
def apply_total_command(ctx: click.Context, skip_source_validation: bool):
"""
Create or update a feature store deployment
"""
repo = ctx.obj["CHDIR"]
cli_check_repo(repo)
repo_config = load_repo_config(repo)
try:
apply_total(repo_config, repo)
apply_total(repo_config, repo, skip_source_validation)
except FeastProviderLoginError as e:
print(str(e))

Expand Down
9 changes: 5 additions & 4 deletions sdk/python/feast/repo_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def parse_repo(repo_root: Path) -> ParsedRepo:


@log_exceptions_and_usage
def apply_total(repo_config: RepoConfig, repo_path: Path):
def apply_total(repo_config: RepoConfig, repo_path: Path, skip_source_validation: bool):
from colorama import Fore, Style

os.chdir(repo_path)
Expand All @@ -133,9 +133,10 @@ def apply_total(repo_config: RepoConfig, repo_path: Path):
repo = parse_repo(repo_path)
data_sources = [t.input for t in repo.feature_views]

# Make sure the data source used by this feature view is supported by Feast
for data_source in data_sources:
data_source.validate(repo_config)
if not skip_source_validation:
# Make sure the data source used by this feature view is supported by Feast
for data_source in data_sources:
data_source.validate(repo_config)

# Make inferences
update_entities_with_inferred_types_from_feature_views(
Expand Down

0 comments on commit c5adb6a

Please sign in to comment.