コード例 #1
0
ファイル: cli.py プロジェクト: tleyden/feast
def entity_create(filename, project):
    """
    Create or update an entity
    """

    entities = [Entity.from_dict(entity_dict) for entity_dict in yaml_loader(filename)]
    feast_client = Client()  # type: Client
    feast_client.apply(entities, project)
コード例 #2
0
def feature_set_create(filename):
    """
    Create or update a feature set
    """

    feature_sets = [FeatureSet.from_dict(fs_dict) for fs_dict in yaml_loader(filename)]
    feast_client = Client()  # type: Client
    feast_client.apply(feature_sets)
コード例 #3
0
ファイル: cli.py プロジェクト: lucaspressi1/feast
def feature_table_create(filename):
    """
    Create or update a feature table
    """

    feature_tables = [
        FeatureTable.from_dict(ft_dict) for ft_dict in yaml_loader(filename)
    ]
    feast_client = Client()  # type: Client
    feast_client.apply_feature_table(feature_tables)
コード例 #4
0
ファイル: entity.py プロジェクト: tedhtchang/feast
    def from_yaml(cls, yml: str):
        """
        Creates an entity from a YAML string body or a file path.

        Args:
            yml: Either a file path containing a yaml file or a YAML string.

        Returns:
            An EntityV2 object based on the YAML file.
        """
        return cls.from_dict(feast_yaml.yaml_loader(yml, load_single=True))
コード例 #5
0
    def from_yaml(cls, yml: str):
        """
        Creates a feature set from a YAML string body or a file path

        Args:
            yml: Either a file path containing a yaml file or a YAML string

        Returns:
            Returns a FeatureSet object based on the YAML file
        """

        return cls.from_dict(feast_yaml.yaml_loader(yml, load_single=True))
コード例 #6
0
ファイル: cli.py プロジェクト: sabarnwa/feast
def feature_set_create(filename):
    """
    Create or update a feature set
    """

    feature_sets = [
        FeatureSet.from_dict(fs_dict) for fs_dict in yaml_loader(filename)
    ]

    feast_client = Client(core_url=feast_config.get_config_property_or_fail(
        "core_url"))  # type: Client

    feast_client.apply(feature_sets)
コード例 #7
0
ファイル: cli.py プロジェクト: ruiguangpei/feast
def apply(filename):
    """
    Apply a configuration to a resource by filename or stdin
    """

    resources = [
        ResourceFactory.get_resource(res_dict["kind"]).from_dict(res_dict)
        for res_dict in yaml_loader(filename)
    ]

    feast_client = Client(core_url=feast_config.get_config_property_or_fail(
        "core_url"))  # type: Client

    feast_client.apply(resources)
コード例 #8
0
ファイル: feature_set.py プロジェクト: ruiguangpei/feast
 def from_yaml(cls, yml):
     return cls.from_dict(feast_yaml.yaml_loader(yml, load_single=True))