Skip to content

Commit 7fa1584

Browse files
committed
feat: added option for api auth
1 parent 93fbd24 commit 7fa1584

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/webapp/databricks.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def delete_inst(self, inst_name: str) -> None:
202202
def fetch_table_data(
203203
self,
204204
catalog_name: str,
205-
schema_name: str,
205+
inst_name: str,
206206
table_name: str,
207207
warehouse_id: str,
208208
limit: int = 1000,
@@ -221,7 +221,10 @@ def fetch_table_data(
221221
raise ValueError(f"Failed to initialize WorkspaceClient: {e}")
222222

223223
# Construct the fully qualified table name
224-
fully_qualified_table = f"`{catalog_name}`.`{schema_name}`.`{table_name}`"
224+
schema_name = databricksify_inst_name(inst_name)
225+
fully_qualified_table = (
226+
f"`{catalog_name}`.`{schema_name}__silver`.`{table_name}`"
227+
)
225228
sql_query = f"SELECT * FROM {fully_qualified_table} LIMIT {limit}"
226229

227230
try:

src/webapp/routers/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ def get_top_features(
10771077
dbc = DatabricksControl()
10781078
rows = dbc.fetch_table_data(
10791079
catalog_name=env_vars["CATALOG_NAME"],
1080-
schema_name=f"{query_result[0][0].name}_silver",
1080+
inst_name=f"{query_result[0][0].name}",
10811081
table_name=f"sample_inference_{run_id}_features_with_most_impact",
10821082
warehouse_id=env_vars["SQL_WAREHOUSE_ID"],
10831083
limit=500,

0 commit comments

Comments
 (0)