Skip to content

Commit bee8076

Browse files
AlexEijssenalex.eijssen
andauthored
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 <alex.eijssen@energyessentials.nl> * Linting issue Signed-off-by: alex.eijssen <alex.eijssen@energyessentials.nl> Co-authored-by: alex.eijssen <alex.eijssen@energyessentials.nl>
1 parent 73a482c commit bee8076

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

sdk/python/feast/infra/offline_stores/contrib/postgres_offline_store/postgres_source.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ def __init__(
1818
created_timestamp_column: Optional[str] = "",
1919
field_mapping: Optional[Dict[str, str]] = None,
2020
date_partition_column: Optional[str] = "",
21+
description: Optional[str] = "",
22+
tags: Optional[Dict[str, str]] = None,
23+
owner: Optional[str] = "",
2124
):
2225
self._postgres_options = PostgreSQLOptions(name=name, query=query)
2326

@@ -27,6 +30,9 @@ def __init__(
2730
created_timestamp_column=created_timestamp_column,
2831
field_mapping=field_mapping,
2932
date_partition_column=date_partition_column,
33+
description=description,
34+
tags=tags,
35+
owner=owner,
3036
)
3137

3238
def __hash__(self):
@@ -57,14 +63,21 @@ def from_proto(data_source: DataSourceProto):
5763
timestamp_field=data_source.timestamp_field,
5864
created_timestamp_column=data_source.created_timestamp_column,
5965
date_partition_column=data_source.date_partition_column,
66+
description=data_source.description,
67+
tags=dict(data_source.tags),
68+
owner=data_source.owner,
6069
)
6170

6271
def to_proto(self) -> DataSourceProto:
6372
data_source_proto = DataSourceProto(
73+
name=self.name,
6474
type=DataSourceProto.CUSTOM_SOURCE,
6575
data_source_class_type="feast.infra.offline_stores.contrib.postgres_offline_store.postgres_source.PostgreSQLSource",
6676
field_mapping=self.field_mapping,
6777
custom_options=self._postgres_options.to_proto(),
78+
description=self.description,
79+
tags=self.tags,
80+
owner=self.owner,
6881
)
6982

7083
data_source_proto.timestamp_field = self.timestamp_field

0 commit comments

Comments
 (0)