Skip to content

Commit 7b2887b

Browse files
committed
Fix trajectory analysis issues and improve Databricks tools (#568)
1 parent 27be244 commit 7b2887b

File tree

20 files changed

+305
-352
lines changed

20 files changed

+305
-352
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ jobs:
215215
env:
216216
DATABRICKS_HOST: "dummy"
217217
DATABRICKS_TOKEN: "dummy"
218+
DATABRICKS_WAREHOUSE_ID: "dummy"
218219

219220
detect-release:
220221
name: Detect Version and Validate

edda/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

edda/edda_agent/src/processor/databricks.rs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl DatabricksTool for DatabricksListTables {
200200
type Error = String;
201201

202202
fn name(&self) -> String {
203-
"databricks_list_tables".to_string()
203+
"databricks_find_tables".to_string()
204204
}
205205

206206
fn definition(&self) -> rig::completion::ToolDefinition {
@@ -253,18 +253,26 @@ impl DatabricksTool for DatabricksListTables {
253253
match client.list_tables(&request).await {
254254
Ok(result) => {
255255
if result.tables.is_empty() {
256-
Ok(Ok(format!(
257-
"No tables found in '{}.{}'.",
258-
args.catalog_name, args.schema_name
259-
)))
256+
let location = match (&args.catalog_name, &args.schema_name) {
257+
(Some(c), Some(s)) => format!("'{}.{}'", c, s),
258+
(Some(c), None) => format!("catalog '{}'", c),
259+
(None, None) => "any catalog/schema".to_string(),
260+
_ => "specified location".to_string(),
261+
};
262+
Ok(Ok(format!("No tables found in {}.", location)))
260263
} else {
261264
Ok(Ok(result.display()))
262265
}
263266
}
264-
Err(e) => Ok(Err(format!(
265-
"Failed to list tables in '{}.{}': {}",
266-
args.catalog_name, args.schema_name, e
267-
))),
267+
Err(e) => {
268+
let location = match (&args.catalog_name, &args.schema_name) {
269+
(Some(c), Some(s)) => format!("'{}.{}'", c, s),
270+
(Some(c), None) => format!("catalog '{}'", c),
271+
(None, None) => "any catalog/schema".to_string(),
272+
_ => "specified location".to_string(),
273+
};
274+
Ok(Err(format!("Failed to list tables in {}: {}", location, e)))
275+
}
268276
}
269277
}
270278
}

0 commit comments

Comments
 (0)