Skip to content

Commit

Permalink
chore: disable table info refreshing for ai_to_sql (#16240)
Browse files Browse the repository at this point in the history
* chore: disable table info refreshing for ai_to_sql

* add stateless test

* chore: commetted out AI stateless test

AI funcs are not testable in CI yet
  • Loading branch information
dantengsky authored Aug 14, 2024
1 parent 41956d0 commit 4db95ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/query/service/src/table_functions/openai/ai_to_sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,14 @@ impl AsyncSource for GPT2SQLSource {
// SELECT
let database = self.ctx.get_current_database();
let tenant = self.ctx.get_tenant();
let catalog = self.ctx.get_catalog(CATALOG_DEFAULT).await?;

// Disable table info refreshing.
// Attached tables may not be able to refresh table info successfully.
let catalog = self
.ctx
.get_catalog(CATALOG_DEFAULT)
.await?
.disable_table_info_refresh()?;

let mut template = vec![];
template.push("### Postgres SQL tables, with their properties:".to_string());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ echo "set data_retention_time_in_days=0;vacuum drop table from issue_16121;" | $

echo "expects no error(nothing outputs)"
echo "drop table issue_16121.attach_read_only" | $BENDSQL_CLIENT_CONNECT

# AI configurations (provider url, ak/sk) are not ready for CI, thus the following test case is commented out
#echo "expects ai_to_sql works"
#echo "SELECT* FROM ai_to_sql ('current time') IGNORE_RESULT" | $BENDSQL_CLIENT_CONNECT

0 comments on commit 4db95ee

Please sign in to comment.