Beispiel #1
0
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)
Beispiel #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)
Beispiel #3
0
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)
Beispiel #4
0
    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))
Beispiel #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))
Beispiel #6
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(core_url=feast_config.get_config_property_or_fail(
        "core_url"))  # type: Client

    feast_client.apply(feature_sets)
Beispiel #7
0
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)
Beispiel #8
0
 def from_yaml(cls, yml):
     return cls.from_dict(feast_yaml.yaml_loader(yml, load_single=True))