MCPcopy Index your code
hub / github.com/feast-dev/feast / validate

Function validate

sdk/python/feast/cli/cli.py:562–600  ·  view source on GitHub ↗

Perform validation of logged features (produced by a given feature service) against provided reference. START_TS and END_TS should be in ISO 8601 format, e.g. '2021-07-16T19:20:01'

(
    ctx: click.Context,
    feature_service: str,
    reference: str,
    start_ts: str,
    end_ts: str,
    no_profile_cache,
)

Source from the content-addressed store, hash-verified

560@click.argument("end_ts")
561@click.pass_context
562def validate(
563 ctx: click.Context,
564 feature_service: str,
565 reference: str,
566 start_ts: str,
567 end_ts: str,
568 no_profile_cache,
569):
570 """
571 Perform validation of logged features (produced by a given feature service) against provided reference.
572
573 START_TS and END_TS should be in ISO 8601 format, e.g. '2021-07-16T19:20:01'
574 """
575 store = create_feature_store(ctx)
576
577 _feature_service = store.get_feature_service(name=feature_service)
578 _reference = store.get_validation_reference(reference)
579
580 result = store.validate_logged_features(
581 source=_feature_service,
582 reference=_reference,
583 start=maybe_local_tz(datetime.fromisoformat(start_ts)),
584 end=maybe_local_tz(datetime.fromisoformat(end_ts)),
585 throw_exception=False,
586 cache_profile=not no_profile_cache,
587 )
588
589 if not result:
590 print(f"{Style.BRIGHT + Fore.GREEN}Validation successful!{Style.RESET_ALL}")
591 return
592
593 errors = [e.to_dict() for e in result.report.errors]
594 formatted_json = json.dumps(errors, indent=4)
595 colorful_json = highlight(
596 formatted_json, lexers.JsonLexer(), formatters.TerminalFormatter()
597 )
598 print(f"{Style.BRIGHT + Fore.RED}Validation failed!{Style.RESET_ALL}")
599 print(colorful_json)
600 exit(1)
601
602
603@cli.command("demo-notebooks")

Callers

nothing calls this directly

Calls 6

create_feature_storeFunction · 0.90
maybe_local_tzFunction · 0.90
get_feature_serviceMethod · 0.45
to_dictMethod · 0.45

Tested by

no test coverage detected