diff --git a/db/model/Variable.ts b/db/model/Variable.ts index 0d064a5bfec..0055d25c348 100644 --- a/db/model/Variable.ts +++ b/db/model/Variable.ts @@ -208,7 +208,7 @@ export async function writeVariableCSV( ): Promise { // get variables as dataframe const variablesDF = ( - await knex.raw( + await readSQLasDF( `-- sql SELECT id as variableId, @@ -216,7 +216,8 @@ export async function writeVariableCSV( columnOrder FROM ?? v WHERE id IN (?)`, - [VariablesTableName, variableIds] + [VariablesTableName, variableIds], + knex ) ).withColumn(pl.col("variableId").cast(pl.Int32))