Skip to content

Commit bcaa701

Browse files
committed
fix: MySQL does not support DROP INDEX IF EXISTS syntax
Use try/except instead since the index may not exist when dropping versioned tables discovered from information_schema. Signed-off-by: yassinnouh21 <yassinnouh21@gmail.com>
1 parent 386d01a commit bcaa701

File tree

1 file changed

+4
-1
lines changed
  • sdk/python/feast/infra/online_stores/mysql_online_store

1 file changed

+4
-1
lines changed

sdk/python/feast/infra/online_stores/mysql_online_store/mysql.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,10 @@ def _drop_all_version_tables(cur: Cursor, project: str, table: FeatureView) -> N
323323
(base, f"^{base}_v[0-9]+$"),
324324
)
325325
for (name,) in cur.fetchall():
326-
cur.execute(f"DROP INDEX IF EXISTS {name}_ek ON {name};")
326+
try:
327+
cur.execute(f"DROP INDEX {name}_ek ON {name};")
328+
except Exception:
329+
pass
327330
cur.execute(f"DROP TABLE IF EXISTS {name}")
328331

329332

0 commit comments

Comments
 (0)