From bee8076085e9f42e783fb9ce5ad07b618d913f0d Mon Sep 17 00:00:00 2001 From: AlexEijssen <70202271+AlexEijssen@users.noreply.github.com> Date: Fri, 24 Jun 2022 16:10:26 +0200 Subject: [PATCH] fix: Correctly generate projects-list.json when calling feast ui and using postgres as a source (#2845) * Adjusted postgres_source.py to create correct projects-list.json when calling feast ui. Signed-off-by: alex.eijssen * Linting issue Signed-off-by: alex.eijssen Co-authored-by: alex.eijssen --- .../postgres_offline_store/postgres_source.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sdk/python/feast/infra/offline_stores/contrib/postgres_offline_store/postgres_source.py b/sdk/python/feast/infra/offline_stores/contrib/postgres_offline_store/postgres_source.py index c76bd7d2f9..74b7a5df8a 100644 --- a/sdk/python/feast/infra/offline_stores/contrib/postgres_offline_store/postgres_source.py +++ b/sdk/python/feast/infra/offline_stores/contrib/postgres_offline_store/postgres_source.py @@ -18,6 +18,9 @@ def __init__( created_timestamp_column: Optional[str] = "", field_mapping: Optional[Dict[str, str]] = None, date_partition_column: Optional[str] = "", + description: Optional[str] = "", + tags: Optional[Dict[str, str]] = None, + owner: Optional[str] = "", ): self._postgres_options = PostgreSQLOptions(name=name, query=query) @@ -27,6 +30,9 @@ def __init__( created_timestamp_column=created_timestamp_column, field_mapping=field_mapping, date_partition_column=date_partition_column, + description=description, + tags=tags, + owner=owner, ) def __hash__(self): @@ -57,14 +63,21 @@ def from_proto(data_source: DataSourceProto): timestamp_field=data_source.timestamp_field, created_timestamp_column=data_source.created_timestamp_column, date_partition_column=data_source.date_partition_column, + description=data_source.description, + tags=dict(data_source.tags), + owner=data_source.owner, ) def to_proto(self) -> DataSourceProto: data_source_proto = DataSourceProto( + name=self.name, type=DataSourceProto.CUSTOM_SOURCE, data_source_class_type="feast.infra.offline_stores.contrib.postgres_offline_store.postgres_source.PostgreSQLSource", field_mapping=self.field_mapping, custom_options=self._postgres_options.to_proto(), + description=self.description, + tags=self.tags, + owner=self.owner, ) data_source_proto.timestamp_field = self.timestamp_field