Bug
Running bash script/preprocess.sh on a clean install crashes with:
File "alphasql/database/utils.py", line 160, in load_value_examples
examples = execute_sql_without_timeout(db_path, f"SELECT DISTINCT `{column_name}` FROM `{table_name}` WHERE `{column_name}` IS NOT NULL AND
`{column_name}` != '' AND length(cast(`{column_name}` as text)) <= {max_example_length} LIMIT {max_num_examples};").result
NameError: name 'max_example_length' is not defined
Root cause
Commit c821bfd ("fix long context issue") added an AND length(cast(... as text)) <= {max_example_length} clause to the SQL f-string in
load_value_examples, but max_example_length was never defined as a parameter, local variable, or module-level constant.
The current function signature is:
def load_value_examples(db_id: str, database_root_dir: str, table_name: str, column_name: str, max_num_examples: int = 3) -> List[str]:
— no max_example_length.
Bug
Running
bash script/preprocess.shon a clean install crashes with:Root cause
Commit c821bfd ("fix long context issue") added an
AND length(cast(... as text)) <= {max_example_length}clause to the SQL f-string inload_value_examples, butmax_example_lengthwas never defined as a parameter, local variable, or module-level constant.The current function signature is:
— no
max_example_length.