Skip to content

Commit 7aad012

Browse files
authored
Add init to Provider contract (#1796)
* 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]>
1 parent 5857a55 commit 7aad012

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

sdk/python/feast/infra/provider.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121

2222
class Provider(abc.ABC):
23+
@abc.abstractmethod
24+
def __init__(self, config: RepoConfig):
25+
...
26+
2327
@abc.abstractmethod
2428
def update_infra(
2529
self,
@@ -161,7 +165,7 @@ def get_provider(config: RepoConfig, repo_path: Path) -> Provider:
161165

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

164-
return cls(config, repo_path)
168+
return cls(config)
165169

166170

167171
def _get_requested_feature_views_to_features_dict(

sdk/python/tests/foo_provider.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414

1515
class FooProvider(Provider):
16+
def __init__(self, config: RepoConfig):
17+
pass
18+
1619
def update_infra(
1720
self,
1821
project: str,
@@ -75,6 +78,3 @@ def online_read(
7578
requested_features: List[str] = None,
7679
) -> List[Tuple[Optional[datetime], Optional[Dict[str, ValueProto]]]]:
7780
pass
78-
79-
def __init__(self, config, repo_path):
80-
pass

0 commit comments

Comments
 (0)