|
12 | 12 |
|
13 | 13 | from feast import Entity |
14 | 14 | from feast.feature_view import FeatureView |
15 | | -from feast.infra.key_encoding_utils import serialize_entity_key, get_val_str |
| 15 | +from feast.infra.key_encoding_utils import get_val_str, serialize_entity_key |
16 | 16 | from feast.infra.online_stores.online_store import OnlineStore |
17 | 17 | from feast.infra.utils.postgres.connection_utils import _get_conn, _get_connection_pool |
18 | 18 | from feast.infra.utils.postgres.postgres_config import ConnectionType, PostgreSQLConfig |
@@ -75,7 +75,10 @@ def online_write_batch( |
75 | 75 |
|
76 | 76 | for feature_name, val in values.items(): |
77 | 77 | val_str: Union[str, bytes] |
78 | | - if "pgvector_enabled" in config.online_config and config.online_config["pgvector_enabled"]: |
| 78 | + if ( |
| 79 | + "pgvector_enabled" in config.online_config |
| 80 | + and config.online_config["pgvector_enabled"] |
| 81 | + ): |
79 | 82 | val_str = get_val_str(val) |
80 | 83 | else: |
81 | 84 | val_str = val.SerializeToString() |
@@ -224,7 +227,10 @@ def update( |
224 | 227 | for table in tables_to_keep: |
225 | 228 | table_name = _table_id(project, table) |
226 | 229 | value_type = "BYTEA" |
227 | | - if "pgvector_enabled" in config.online_config and config.online_config["pgvector_enabled"]: |
| 230 | + if ( |
| 231 | + "pgvector_enabled" in config.online_config |
| 232 | + and config.online_config["pgvector_enabled"] |
| 233 | + ): |
228 | 234 | value_type = f'vector({config.online_config["vector_len"]})' |
229 | 235 | cur.execute( |
230 | 236 | sql.SQL( |
|
0 commit comments