real world example fails to launch
Hi I tried running the real world example you have but I'm getting the following error:
`PS C:\Code\fastapiBench> uvicorn --host 0.0.0.0 --port 6969 charts:server INFO: Started server process [19284] 08-19 00:39:41 uvicorn.error INFO Started server process [19284] INFO: Waiting for application startup. 08-19 00:39:41 uvicorn.error INFO Waiting for application startup. 08-19 00:39:41 aiopyql-db-charts_database.db ERROR error during create_table - KeyError(1660865981.261195) Traceback (most recent call last): File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\data.py", line 565, in create_table result = await new_table.create_schema() File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\table.py", line 63, in create_schema return await self.database.run(await self.get_schema()) File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\data.py", line 447, in run self.cache_check(query) File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\data.py", line 294, in cache_check for cache, _ in self.cache: File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\cache.py", line 37, in cache_generator yield cache_key, self.timestamp_to_cache[timestamp][0] KeyError: 1660865981.261195 08-19 00:39:41 aiopyql-db-charts_database.db ERROR error during create_table - KeyError(1660865981.261195) Traceback (most recent call last): File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\data.py", line 565, in create_table result = await new_table.create_schema() File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\table.py", line 63, in create_schema return await self.database.run(await self.get_schema()) File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\data.py", line 447, in run self.cache_check(query) File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\data.py", line 294, in cache_check for cache, _ in self.cache: File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\cache.py", line 37, in cache_generator yield cache_key, self.timestamp_to_cache[timestamp][0] KeyError: 1660865981.261195 08-19 00:39:41 aiopyql-db-charts_database.db ERROR exception inserting into test Traceback (most recent call last): File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\table.py", line 445, in insert result = await self.database.run(query) File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\data.py", line 447, in run self.cache_check(query) File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\data.py", line 294, in cache_check for cache, _ in self.cache: File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\cache.py", line 37, in cache_generator yield cache_key, self.timestamp_to_cache[timestamp][0] KeyError: 1660865981.261195 ERROR: Traceback (most recent call last): File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 635, in lifespan async with self.lifespan_context(app): File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 530, in aenter await self._router.startup() File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 612, in startup await handler() File "C:\Code\fastapiBench.\charts.py", line 21, in setup await server.charts.create_dataset( File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\easycharts\charts.py", line 185, in create_dataset await self.db.tables[name].insert( File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\table.py", line 452, in insert raise e File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\table.py", line 445, in insert result = await self.database.run(query) File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\data.py", line 447, in run self.cache_check(query) File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\data.py", line 294, in cache_check for cache, _ in self.cache: File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\cache.py", line 37, in cache_generator yield cache_key, self.timestamp_to_cache[timestamp][0] KeyError: 1660865981.261195
08-19 00:39:41 uvicorn.error ERROR Traceback (most recent call last): File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 635, in lifespan async with self.lifespan_context(app): File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 530, in aenter File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 612, in startup await handler() File "C:\Code\fastapiBench.\charts.py", line 21, in setup File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\easycharts\charts.py", line 185, in create_dataset await self.db.tables[name].insert( File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\table.py", line 452, in insert File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\table.py", line 445, in insert result = await self.database.run(query) File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\data.py", line 447, in run self.cache_check(query) File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\data.py", line 294, in cache_check for cache, _ in self.cache: File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\aiopyql\cache.py", line 37, in cache_generator yield cache_key, self.timestamp_to_cache[timestamp][0] KeyError: 1660865981.261195
ERROR: Application startup failed. Exiting.
08-19 00:39:41 uvicorn.error ERROR Application startup failed. Exiting.
PS C:\Code\fastapiBench> & C:/Users/mac/AppData/Local/Programs/Python/Python310/python.exe c:/Code/fastapiBench/charts.py
File "c:\Code\fastapiBench\charts.py", line 21
await server.charts.create_dataset(
IndentationError: unexpected indent
PS C:\Code\fastapiBench> & C:/Users/mac/AppData/Local/Programs/Python/Python310/python.exe c:/Code/fastapiBench/charts.py
File "c:\Code\fastapiBench\charts.py", line 21
await server.charts.create_dataset(
IndentationError: unexpected indent
PS C:\Code\fastapiBench> uvicorn --host 0.0.0.0 --port 6969 charts:server
Traceback (most recent call last):
File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\mac\AppData\Local\Programs\Python\Python310\Scripts\uvicorn.exe_main.py", line 7, in
08-19 00:40:32 uvicorn.error ERROR Traceback (most recent call last): File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 635, in lifespan async with self.lifespan_context(app): File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 530, in aenter await self._router.startup() File "C:\Users\mac\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 612, in startup await handler() File "C:\Code\fastapiBench.\charts.py", line 15, in setup await server.charts.create_dataset( AttributeError: 'FastAPI' object has no attribute 'charts'
ERROR: Application startup failed. Exiting. 08-19 00:40:32 uvicorn.error ERROR Application startup failed. Exiting.`
Using:
uvicorn --host 0.0.0.0 --port 6969 charts:server
As the command to run it as well.