Skip to content

Commit 2624b22

Browse files
committed
format
1 parent a51b555 commit 2624b22

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

sdk/python/feast/infra/key_encoding_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
def _serialize_val(
10-
value_type, v: ValueProto, entity_key_serialization_version=1
10+
value_type, v: ValueProto, entity_key_serialization_version=1
1111
) -> Tuple[bytes, int]:
1212
if value_type == "string_val":
1313
return v.string_val.encode("utf8"), ValueType.STRING
@@ -40,7 +40,7 @@ def serialize_entity_key_prefix(entity_keys: List[str]) -> bytes:
4040

4141

4242
def serialize_entity_key(
43-
entity_key: EntityKeyProto, entity_key_serialization_version=1
43+
entity_key: EntityKeyProto, entity_key_serialization_version=1
4444
) -> bytes:
4545
"""
4646
Serialize entity key to a bytestring so it can be used as a lookup key in a hash table.

sdk/python/feast/infra/online_stores/contrib/postgres.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from feast import Entity
1414
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
1616
from feast.infra.online_stores.online_store import OnlineStore
1717
from feast.infra.utils.postgres.connection_utils import _get_conn, _get_connection_pool
1818
from feast.infra.utils.postgres.postgres_config import ConnectionType, PostgreSQLConfig
@@ -75,7 +75,10 @@ def online_write_batch(
7575

7676
for feature_name, val in values.items():
7777
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+
):
7982
val_str = get_val_str(val)
8083
else:
8184
val_str = val.SerializeToString()
@@ -224,7 +227,10 @@ def update(
224227
for table in tables_to_keep:
225228
table_name = _table_id(project, table)
226229
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+
):
228234
value_type = f'vector({config.online_config["vector_len"]})'
229235
cur.execute(
230236
sql.SQL(

0 commit comments

Comments
 (0)