How to override a non doctype class in frappe

i wan to override meta class but its not a doctype , so is there a way to overide it

@msanjay can you give an more clear example?

Monkey patching might help but it’s not multi-tenancy safe. Also, overriding something so foundational as Meta is probably not a good idea. Can you share your requirement to be able to extend Meta?

Traceback (most recent call last):
File “apps/frappe/frappe/”, line 66, in application
response = frappe.api.handle()
File “apps/frappe/frappe/”, line 54, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/”, line 45, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/”, line 83, in execute_cmd
return, **frappe.form_dict)
File “apps/frappe/frappe/init .py”, line 1607, in call
return fn(*args, **newargs)
File “apps/frappe/frappe/integrations/doctype/google_settings/”, line 15, in get_file_picker_settings
google_settings = frappe.get_single(“Google Settings”)
File “apps/frappe/frappe/init .py”, line 1204, in get_single
return get_doc(doctype, doctype)
File “apps/frappe/frappe/init .py”, line 1184, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “apps/frappe/frappe/model/”, line 74, in get_doc
return controller(*args, **kwargs)
File “apps/frappe/frappe/model/”, line 106, in init
File “apps/frappe/frappe/model/”, line 140, in load_from_db
super().init (single_doc)
File “apps/frappe/frappe/model/”, line 105, in init
self._table_fieldnames = {df.fieldname for df in self._get_table_fields()}
File “apps/frappe/frappe/model/”, line 294, in _get_table_fields
return self.meta.get_table_fields()
File “apps/frappe/frappe/model/”, line 211, in get_table_fields
return self._table_fields
AttributeError: ‘Meta’ object has no attribute ‘_table_fields’

i am getting this error, i am not getting any solution to resolve this
thats why i wanted to override this class

Did you manage to solve this @msanjay ? I’m encountering this issue as well and its intermittent, but persistent.