From a3b2a64a1dfcdb29ec347330f43f1479177b0fb0 Mon Sep 17 00:00:00 2001 From: "guangli.bao" Date: Tue, 2 Dec 2025 12:45:28 +0800 Subject: [PATCH] fix Dataset.from_sql() missing argument: sql Signed-off-by: guangli.bao --- src/guidellm/data/deserializers/file.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/guidellm/data/deserializers/file.py b/src/guidellm/data/deserializers/file.py index f46e0ae52..b58c83712 100644 --- a/src/guidellm/data/deserializers/file.py +++ b/src/guidellm/data/deserializers/file.py @@ -196,7 +196,18 @@ def __call__( f"expected str or Path to a local .db file, got {data}" ) - return Dataset.from_sql(con=str(path), **data_kwargs) + import sqlite3 + + conn = sqlite3.connect(path) + cursor = conn.cursor() + table = cursor.execute( + "SELECT name FROM sqlite_master WHERE type='table'" + ).fetchone()[0] + conn.close() + + query = f"SELECT * FROM {table}" # noqa: S608 ignore table name injection risk + + return Dataset.from_sql(sql=query, con=str(path), **data_kwargs) @DatasetDeserializerFactory.register("tar_file")