Skip to content

Commit

Permalink
Add init to Provider contract (#1796)
Browse files Browse the repository at this point in the history
* Add init to provider

Signed-off-by: Willem Pienaar <[email protected]>

* Update call site to not have repo_path

Signed-off-by: Willem Pienaar <[email protected]>

* Add init to FooProvider

Signed-off-by: Willem Pienaar <[email protected]>
  • Loading branch information
woop authored Aug 30, 2021
1 parent 5857a55 commit 7aad012
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion sdk/python/feast/infra/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@


class Provider(abc.ABC):
@abc.abstractmethod
def __init__(self, config: RepoConfig):
...

@abc.abstractmethod
def update_infra(
self,
Expand Down Expand Up @@ -161,7 +165,7 @@ def get_provider(config: RepoConfig, repo_path: Path) -> Provider:

cls = importer.get_class_from_type(module_name, class_name, "Provider")

return cls(config, repo_path)
return cls(config)


def _get_requested_feature_views_to_features_dict(
Expand Down
6 changes: 3 additions & 3 deletions sdk/python/tests/foo_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@


class FooProvider(Provider):
def __init__(self, config: RepoConfig):
pass

def update_infra(
self,
project: str,
Expand Down Expand Up @@ -75,6 +78,3 @@ def online_read(
requested_features: List[str] = None,
) -> List[Tuple[Optional[datetime], Optional[Dict[str, ValueProto]]]]:
pass

def __init__(self, config, repo_path):
pass

0 comments on commit 7aad012

Please sign in to comment.