Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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[SqlRegistryConfig],
Copy link
Copy Markdown
Collaborator

@sudohainguyen sudohainguyen Apr 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @davidschuler-8451 I have another idea, let's make this one Optional[Union[RegistryConfig, SqlRegistryConfig]]

this should work as a charm

project: str,
repo_path: Optional[Path],
):
Expand Down