|
25 | 25 | from dateutil import parser |
26 | 26 | from pygments import formatters, highlight, lexers |
27 | 27 |
|
28 | | -from feast import flags, flags_helper, utils |
| 28 | +from feast import utils |
29 | 29 | from feast.constants import DEFAULT_FEATURE_TRANSFORMATION_SERVER_PORT |
30 | 30 | from feast.errors import FeastObjectNotFoundException, FeastProviderLoginError |
31 | 31 | from feast.feature_store import FeatureStore |
@@ -691,113 +691,6 @@ def serve_transformations_command(ctx: click.Context, port: int): |
691 | 691 | store.serve_transformations(port) |
692 | 692 |
|
693 | 693 |
|
694 | | -@cli.group(name="alpha") |
695 | | -def alpha_cmd(): |
696 | | - """ |
697 | | - Access alpha features |
698 | | - """ |
699 | | - pass |
700 | | - |
701 | | - |
702 | | -@alpha_cmd.command("list") |
703 | | -@click.pass_context |
704 | | -def list_alpha_features(ctx: click.Context): |
705 | | - """ |
706 | | - Lists all alpha features |
707 | | - """ |
708 | | - repo = ctx.obj["CHDIR"] |
709 | | - cli_check_repo(repo) |
710 | | - repo_path = str(repo) |
711 | | - store = FeatureStore(repo_path=repo_path) |
712 | | - |
713 | | - flags_to_show = flags.FLAG_NAMES.copy() |
714 | | - flags_to_show.remove(flags.FLAG_ALPHA_FEATURES_NAME) |
715 | | - print("Alpha features:") |
716 | | - for flag in flags_to_show: |
717 | | - enabled_string = ( |
718 | | - "enabled" |
719 | | - if flags_helper.feature_flag_enabled(store.config, flag) |
720 | | - else "disabled" |
721 | | - ) |
722 | | - print(f"{flag}: {enabled_string}") |
723 | | - |
724 | | - |
725 | | -@alpha_cmd.command("enable-all") |
726 | | -@click.pass_context |
727 | | -def enable_alpha_features(ctx: click.Context): |
728 | | - """ |
729 | | - Enables all alpha features |
730 | | - """ |
731 | | - repo = ctx.obj["CHDIR"] |
732 | | - cli_check_repo(repo) |
733 | | - repo_path = str(repo) |
734 | | - store = FeatureStore(repo_path=repo_path) |
735 | | - |
736 | | - if store.config.flags is None: |
737 | | - store.config.flags = {} |
738 | | - for flag_name in flags.FLAG_NAMES: |
739 | | - store.config.flags[flag_name] = True |
740 | | - store.config.write_to_path(Path(repo_path)) |
741 | | - |
742 | | - |
743 | | -@alpha_cmd.command("enable") |
744 | | -@click.argument("name", type=click.STRING) |
745 | | -@click.pass_context |
746 | | -def enable_alpha_feature(ctx: click.Context, name: str): |
747 | | - """ |
748 | | - Enables an alpha feature |
749 | | - """ |
750 | | - if name not in flags.FLAG_NAMES: |
751 | | - raise ValueError(f"Flag name, {name}, not valid.") |
752 | | - |
753 | | - repo = ctx.obj["CHDIR"] |
754 | | - cli_check_repo(repo) |
755 | | - repo_path = str(repo) |
756 | | - store = FeatureStore(repo_path=repo_path) |
757 | | - |
758 | | - if store.config.flags is None: |
759 | | - store.config.flags = {} |
760 | | - store.config.flags[flags.FLAG_ALPHA_FEATURES_NAME] = True |
761 | | - store.config.flags[name] = True |
762 | | - store.config.write_to_path(Path(repo_path)) |
763 | | - |
764 | | - |
765 | | -@alpha_cmd.command("disable") |
766 | | -@click.argument("name", type=click.STRING) |
767 | | -@click.pass_context |
768 | | -def disable_alpha_feature(ctx: click.Context, name: str): |
769 | | - """ |
770 | | - Disables an alpha feature |
771 | | - """ |
772 | | - if name not in flags.FLAG_NAMES: |
773 | | - raise ValueError(f"Flag name, {name}, not valid.") |
774 | | - |
775 | | - repo = ctx.obj["CHDIR"] |
776 | | - cli_check_repo(repo) |
777 | | - repo_path = str(repo) |
778 | | - store = FeatureStore(repo_path=repo_path) |
779 | | - |
780 | | - if store.config.flags is None or name not in store.config.flags: |
781 | | - return |
782 | | - store.config.flags[name] = False |
783 | | - store.config.write_to_path(Path(repo_path)) |
784 | | - |
785 | | - |
786 | | -@alpha_cmd.command("disable-all") |
787 | | -@click.pass_context |
788 | | -def disable_alpha_features(ctx: click.Context): |
789 | | - """ |
790 | | - Disables all alpha features |
791 | | - """ |
792 | | - repo = ctx.obj["CHDIR"] |
793 | | - cli_check_repo(repo) |
794 | | - repo_path = str(repo) |
795 | | - store = FeatureStore(repo_path=repo_path) |
796 | | - |
797 | | - store.config.flags = None |
798 | | - store.config.write_to_path(Path(repo_path)) |
799 | | - |
800 | | - |
801 | 694 | @cli.command("validate") |
802 | 695 | @click.option( |
803 | 696 | "--feature-service", |
|
0 commit comments