Skip to content

Commit

Permalink
refactor: split InsightsDataSource class methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Mar 2, 2024
1 parent 20f407a commit e9a9339
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 183 deletions.
8 changes: 5 additions & 3 deletions frontend/src/query/NativeQueryEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ const props = defineProps({
const query = inject('query')
if (query.doc.data_source) {
call('insights.api.data_sources.get_source_schema', {
data_source: query.doc.data_source,
call('run_doc_method', {
method: 'get_schema',
dt: 'Insights Data Source',
dn: query.doc.data_source,
}).then((response) => {
query.sourceSchema = response
query.sourceSchema = response.message
})
}
const completions = computed(() => {
Expand Down
5 changes: 0 additions & 5 deletions insights/api/data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,6 @@ def fetch_column_values(data_source, table, column, search_text=None):
return doc.get_column_options(table, column, search_text)


@frappe.whitelist()
def get_source_schema(data_source):
return frappe.get_doc("Insights Data Source", data_source).get_schema()


@frappe.whitelist()
def get_relation(data_source, table_one, table_two):
table_one_doc = InsightsTable.get_doc({"data_source": data_source, "table": table_one})
Expand Down
Loading

0 comments on commit e9a9339

Please sign in to comment.