Skip to content

Commit

Permalink
fix: Fix bug with no SqlRegistryConfig class (#3586)
Browse files Browse the repository at this point in the history
* adding SqlRegistryConfig class

Signed-off-by: davidschuler-8451 <[email protected]>

* refactor: move SqlRegistryConfig class to sql.py

Signed-off-by: davidschuler-8451 <[email protected]>

* enabling SqlRegistry to accept RegistryConfig or SqlRegistryConfig

Signed-off-by: davidschuler-8451 <[email protected]>

---------

Signed-off-by: davidschuler-8451 <[email protected]>
  • Loading branch information
davidschuler-8451 authored Apr 21, 2023
1 parent 6c09c39 commit 6dc1368
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion sdk/python/feast/infra/registry/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from threading import Lock
from typing import Any, Callable, List, Optional, Set, Union

from pydantic import StrictStr
from sqlalchemy import ( # type: ignore
BigInteger,
Column,
Expand Down Expand Up @@ -178,10 +179,19 @@ class FeastMetadataKeys(Enum):
)


class SqlRegistryConfig(RegistryConfig):
registry_type: StrictStr = "sql"
""" str: Provider name or a class name that implements Registry."""

path: StrictStr = ""
""" str: Path to metadata store.
If registry_type is 'sql', then this is a database URL as expected by SQLAlchemy """


class SqlRegistry(BaseRegistry):
def __init__(
self,
registry_config: Optional[RegistryConfig],
registry_config: Optional[Union[RegistryConfig, SqlRegistryConfig]],
project: str,
repo_path: Optional[Path],
):
Expand Down

0 comments on commit 6dc1368

Please sign in to comment.