Error while loading virtual doctype list View

While loading the list view of the virtual doctype,error occurs as Values are not getting Fetched . I had followed what is mentioned in the virtual doctype Frappe documentation

import frappe
from frappe.model.document import Document

import os
import json

class TestVirtual(Document):

DATA_FILE = "test_virtual.json"
def get_current_data() -> dict[str, dict]:
	if not os.path.exists(TestVirtual.DATA_FILE):
		return {}

	with open(TestVirtual.DATA_FILE) as f:
		return json.load(f)

def update_data(data: dict[str, dict]) -> None:
	with open(TestVirtual.DATA_FILE, "w+") as test_virtual:
		json.dump(data, test_virtual)

def db_insert(self):
	d = self.get_valid_dict(convert_dates_to_str=True)
	data = self.get_current_data()
	data[] = d

def load_from_db(self):
	data = self.get_current_data()
	d = data.get(
	super(Document, self).__init__(d)

def db_update(self,*args, **kwargs):
	self.db_insert(*args, **kwargs)

def delete(self):
	data = self.get_current_data()
	data.pop(, None)

def get_list(self, args):
	data = TestVirtual.get_current_data()
	return [frappe._dict(doc) for name, doc in data.items()]

def get_count(self, args):
	data = TestVirtual.get_current_data()
	return len(data)

def get_stats(self, args):
	return {}


Check where your json file is located … base directory is “your-bench/sites”
Hope this helps.