How to auto update Big query automatically?

Hi,

I have a lot of query store that are inside a big query and I need to manually update them for them to be accurate in the big query.

Is there a way thay they auto-update daily?

Thank you for your help.

Do they all belong to the same data source? or are you using query store to merge different data source’s queries?

They belong to the same data source (my ERPNext data base source), but I use Query Store to merge different queries.

You don’t need to use Query Store to merge different queries from the same data source. Query Store is unstable as of now.

If you have enabled the below checkbox in the settings, you should be able to select any query just like a table in any other query.

Also, if you are on the latest v1.1.1 then you will have to save the query as a table manually, to select it as a table in any other query

Thanks for the answer. I tried the Table method but it is not working :



It gives Internal Server Error.

Thank you for your help!

Can you post the error here from the browser console?

@nextchamp.saqib
From the browser console :

exc
:
“["Traceback (most recent call last):\n File \"apps/frappe/frappe/app.py\", line 94, in application\n response = frappe.api.handle()\n File \"apps/frappe/frappe/api.py\", line 54, in handle\n return frappe.handler.handle()\n File \"apps/frappe/frappe/handler.py\", line 47, in handle\n data = execute_cmd(cmd)\n File \"apps/frappe/frappe/handler.py\", line 85, in execute_cmd\n return frappe.call(method, **frappe.form_dict)\n File \"apps/frappe/frappe/init.py\", line 1622, in call\n return fn(*args, **newargs)\n File \"apps/frappe/frappe/handler.py\", line 312, in run_doc_method\n response = doc.run_method(method, **args)\n File \"apps/frappe/frappe/model/document.py\", line 915, in run_method\n out = Document.hook(fn)(self, *args, **kwargs)\n File \"apps/frappe/frappe/model/document.py\", line 1277, in composer\n return composed(self, method, *args, **kwargs)\n File \"apps/frappe/frappe/model/document.py\", line 1259, in runner\n add_to_return_value(self, fn(self, *args, **kwargs))\n File \"apps/frappe/frappe/model/document.py\", line 912, in fn\n return method_object(*args, **kwargs)\n File \"apps/insights/insights/insights/doctype/insights_query/insights_legacy_query.py\", line 54, in update_table\n self.save()\n File \"apps/frappe/frappe/model/document.py\", line 305, in save\n return self._save(*args, **kwargs)\n File \"apps/frappe/frappe/model/document.py\", line 339, in _save\n self.run_before_save_methods()\n File \"apps/frappe/frappe/model/document.py\", line 1052, in run_before_save_methods\n self.run_method(\"before_save\")\n File \"apps/frappe/frappe/model/document.py\", line 915, in run_method\n out = Document.hook(fn)(self, *args, **kwargs)\n File \"apps/frappe/frappe/model/document.py\", line 1277, in composer\n return composed(self, method, *args, **kwargs)\n File \"apps/frappe/frappe/model/document.py\", line 1259, in runner\n add_to_return_value(self, fn(self, *args, **kwargs))\n File \"apps/frappe/frappe/model/document.py\", line 912, in fn\n return method_object(*args, **kwargs)\n File \"apps/insights/insights/insights/doctype/insights_query/insights_query.py\", line 44, in before_save\n self.variant_controller.before_save()\n File \"apps/insights/insights/insights/doctype/insights_query/insights_legacy_query.py\", line 253, in before_save\n update_sql(self.doc)\n File \"apps/insights/insights/insights/doctype/insights_query/utils.py\", line 63, in update_sql\n sql = data_source.build_query(query)\n File \"apps/insights/insights/insights/doctype/insights_data_source/insights_data_source.py\", line 135, in build_query\n return self.db.build_query(query)\n File \"apps/insights/insights/insights/doctype/insights_data_source/sources/base_database.py\", line 46, in build_query\n query_str = self.query_builder.build(query, dialect=self.engine.dialect)\n File \"apps/insights/insights/insights/query_builders/sql_builder.py\", line 511, in build\n self.process_tables_and_joins()\n File \"apps/insights/insights/insights/query_builders/sql_builder.py\", line 541, in process_tables_and_joins\n left_key = condition.get(\"left\").get(\"value\")\nAttributeError: ‘str’ object has no attribute ‘get’\n"]”
exception
:
“AttributeError: ‘str’ object has no attribute ‘get’”

Just pushed a fix. Try updating and check if it works

Still got the same error message :

{
“exception”: “AttributeError: ‘str’ object has no attribute ‘get’”,
“exc”: “["Traceback (most recent call last):\n File \"apps/frappe/frappe/app.py\", line 94, in application\n response = frappe.api.handle()\n File \"apps/frappe/frappe/api.py\", line 54, in handle\n return frappe.handler.handle()\n File \"apps/frappe/frappe/handler.py\", line 47, in handle\n data = execute_cmd(cmd)\n File \"apps/frappe/frappe/handler.py\", line 85, in execute_cmd\n return frappe.call(method, **frappe.form_dict)\n File \"apps/frappe/frappe/init.py\", line 1622, in call\n return fn(*args, **newargs)\n File \"apps/frappe/frappe/handler.py\", line 312, in run_doc_method\n response = doc.run_method(method, **args)\n File \"apps/frappe/frappe/model/document.py\", line 917, in run_method\n out = Document.hook(fn)(self, *args, **kwargs)\n File \"apps/frappe/frappe/model/document.py\", line 1279, in composer\n return composed(self, method, *args, **kwargs)\n File \"apps/frappe/frappe/model/document.py\", line 1261, in runner\n add_to_return_value(self, fn(self, *args, **kwargs))\n File \"apps/frappe/frappe/model/document.py\", line 914, in fn\n return method_object(*args, **kwargs)\n File \"apps/insights/insights/insights/doctype/insights_query/insights_legacy_query.py\", line 54, in update_table\n self.save()\n File \"apps/frappe/frappe/model/document.py\", line 307, in save\n return self._save(*args, **kwargs)\n File \"apps/frappe/frappe/model/document.py\", line 341, in _save\n self.run_before_save_methods()\n File \"apps/frappe/frappe/model/document.py\", line 1054, in run_before_save_methods\n self.run_method(\"before_save\")\n File \"apps/frappe/frappe/model/document.py\", line 917, in run_method\n out = Document.hook(fn)(self, *args, **kwargs)\n File \"apps/frappe/frappe/model/document.py\", line 1279, in composer\n return composed(self, method, *args, **kwargs)\n File \"apps/frappe/frappe/model/document.py\", line 1261, in runner\n add_to_return_value(self, fn(self, *args, **kwargs))\n File \"apps/frappe/frappe/model/document.py\", line 914, in fn\n return method_object(*args, **kwargs)\n File \"apps/insights/insights/insights/doctype/insights_query/insights_query.py\", line 44, in before_save\n self.variant_controller.before_save()\n File \"apps/insights/insights/insights/doctype/insights_query/insights_legacy_query.py\", line 253, in before_save\n update_sql(self.doc)\n File \"apps/insights/insights/insights/doctype/insights_query/utils.py\", line 63, in update_sql\n sql = data_source.build_query(query)\n File \"apps/insights/insights/insights/doctype/insights_data_source/insights_data_source.py\", line 135, in build_query\n return self.db.build_query(query)\n File \"apps/insights/insights/insights/doctype/insights_data_source/sources/base_database.py\", line 46, in build_query\n query_str = self.query_builder.build(query, dialect=self.engine.dialect)\n File \"apps/insights/insights/insights/query_builders/sql_builder.py\", line 511, in build\n self.process_tables_and_joins()\n File \"apps/insights/insights/insights/query_builders/sql_builder.py\", line 541, in process_tables_and_joins\n left_key = condition.get(\"left\").get(\"value\")\nAttributeError: ‘str’ object has no attribute ‘get’\n"]”
}

Are you on latest develop branch?

Yes I am on v. v1.1.3 (HEAD)

update to v1.1.5 now and check