Skip to content

Commit

Permalink
feat: SQLAlchemy Registry Support (#2734)
Browse files Browse the repository at this point in the history
* feat: WIP SQLAlchemy Registry Support

Signed-off-by: Achal Shah <[email protected]>

* hack hack hack

Signed-off-by: Achal Shah <[email protected]>

* fix repo config

Signed-off-by: Achal Shah <[email protected]>

* reduce duplication

Signed-off-by: Achal Shah <[email protected]>

* simplify

Signed-off-by: Achal Shah <[email protected]>

* postgres tests

Signed-off-by: Achal Shah <[email protected]>

* tests for pg and mysql

Signed-off-by: Achal Shah <[email protected]>

* fix requirements

Signed-off-by: Achal Shah <[email protected]>

* pin protobuf again

Signed-off-by: Achal Shah <[email protected]>

* fix macos test

Signed-off-by: Achal Shah <[email protected]>

* fix macos test

Signed-off-by: Achal Shah <[email protected]>

* fix quotes

Signed-off-by: Achal Shah <[email protected]>

* add macos

Signed-off-by: Achal Shah <[email protected]>

* remove macos

Signed-off-by: Achal Shah <[email protected]>

* install mysql library but don't try to run tests

Signed-off-by: Achal Shah <[email protected]>

* Fix CR comments

Signed-off-by: Achal Shah <[email protected]>

* add a comment

Signed-off-by: Achal Shah <[email protected]>
  • Loading branch information
achals authored Jun 3, 2022
1 parent d024e5e commit b3fe39c
Show file tree
Hide file tree
Showing 14 changed files with 1,088 additions and 47 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
fail-fast: false
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
os: [ ubuntu-latest, macOS-latest]
os: [ ubuntu-latest, macOS-latest ]
exclude:
- os: macOS-latest
python-version: "3.8"
Expand All @@ -32,9 +32,14 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.17.7
- name: Install mysql on macOS
if: startsWith(matrix.os, 'macOS')
run: |
brew install mysql
PATH=$PATH:/usr/local/mysql/bin
- name: Upgrade pip version
run: |
pip install --upgrade "pip>=21.3.1,<22.1"
pip install --upgrade "pip>=22.1,<23"
- name: Get pip cache dir
id: pip-cache
run: |
Expand Down Expand Up @@ -83,7 +88,7 @@ jobs:
python-version: "3.7"
- name: Upgrade pip version
run: |
pip install --upgrade "pip>=21.3.1,<22.1"
pip install --upgrade "pip>=22.1,<23"
- name: Setup Go
id: setup-go
uses: actions/setup-go@v2
Expand Down
8 changes: 6 additions & 2 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
)
from feast.infra.infra_object import Infra
from feast.infra.provider import Provider, RetrievalJob, get_provider
from feast.infra.registry_stores.sql import SqlRegistry
from feast.on_demand_feature_view import OnDemandFeatureView
from feast.online_response import OnlineResponse
from feast.protos.feast.core.InfraObject_pb2 import Infra as InfraProto
Expand Down Expand Up @@ -138,8 +139,11 @@ def __init__(
raise ValueError("Please specify one of repo_path or config.")

registry_config = self.config.get_registry_config()
self._registry = Registry(registry_config, repo_path=self.repo_path)
self._registry._initialize_registry()
if registry_config.registry_type == "sql":
self._registry = SqlRegistry(registry_config, None)
else:
self._registry = Registry(registry_config, repo_path=self.repo_path)
self._registry._initialize_registry()
self._provider = get_provider(self.config, self.repo_path)
self._go_server = None

Expand Down
Loading

0 comments on commit b3fe39c

Please sign in to comment.