Skip to content
Prev Previous commit
format
Signed-off-by: hao-affirm <104030690+hao-affirm@users.noreply.github.com>
  • Loading branch information
hao-affirm committed Sep 10, 2022
commit 0d7d8319cbba6001e804cb2f77ef2bb0db09e06b
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytz
from pydantic import StrictStr
from pymysql.connections import Connection
from pymysql.cursors import Cursor

from feast import Entity, FeatureView, RepoConfig
from feast.infra.key_encoding_utils import serialize_entity_key
Expand All @@ -31,7 +32,6 @@ class MySQLOnlineStoreConfig(FeastConfigBaseModel):
port: Optional[int] = None



class MySQLOnlineStore(OnlineStore):
"""
An online store implementation that uses MySQL.
Expand Down Expand Up @@ -208,11 +208,9 @@ def teardown(
_drop_table_and_index(cur, project, table)


def _drop_table_and_index(cur, project: str, table: FeatureView) -> None:
def _drop_table_and_index(cur: Cursor, project: str, table: FeatureView) -> None:
table_name = _table_id(project, table)
cur.execute(
f"DROP INDEX {table_name}_ek ON {table_name};"
)
cur.execute(f"DROP INDEX {table_name}_ek ON {table_name};")
cur.execute(f"DROP TABLE IF EXISTS {table_name}")


Expand Down