I am working on a FastAPI python application with SQLAlchemy, and I am getting the following error:
```
2023-11-16 00:23:34,059 INFO sqlalchemy.engine.Engine BEGIN (implicit)
2023-11-16 00:23:34,059 INFO sqlalchemy.engine.Engine SELECT posts.id, posts.created_at, posts.score, posts.width, posts.height, posts.md5, posts.directory, posts.image, posts.rating, posts.source, posts.change, posts.owner, posts.creator_id, posts.parent_id, posts.sample, posts.preview_height, posts.preview_width, posts.tags, posts.title, posts.has_notes, posts.has_comments, posts.file_url, posts.preview_url, posts.sample_url, posts.sample_height, posts.sample_width, posts.status, posts.post_locked, posts.has_children
FROM posts
2023-11-16 00:23:34,060 INFO sqlalchemy.engine.Engine [cached since 24.98s ago] ()  
2023-11-16 00:23:34,086 INFO sqlalchemy.engine.Engine ROLLBACK
INFO:     127.0.0.1:14925 - "GET /gelbooru/get/ HTTP/1.1" 500 Internal Server Error 
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 426, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\fastapi\applications.py", line 1106, in __call__
    await super().__call__(scope, receive, send)
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\starlette\applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 20, in __call__
    raise e
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\starlette\routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\starlette\routing.py", line 66, in app
    response = await func(request)
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\fastapi\routing.py", line 274, in app
    raw_response = await run_endpoint_function(
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\venv\lib\site-packages\fastapi\routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\main.py", line 85, in gelbooru_get
    posts_data = [dict(result) for result in results]
  File "D:\AI Generation\Projects\ai-webui\aidili-fastreact\backend\main.py", line 85, in <listcomp>
    posts_data = [dict(result) for result in results]
TypeError: cannot convert dictionary update sequence element #0 to a sequence   
```
I have 2 FastAPI end points, I first run /gelbooru/get/, since the table has not been created yet, it initializes it, but otherwise returns an empty list, I then run /gelbooru/scrape/, which pulls in around 100 posts and successfully(seemingly) populates the database without error, then when I run /gelbooru/get/ again, I get the error as I posted above, this is the relevant code in main.py, the scrape_gelbooru() function is something I wrote and extensively tested, it returns a list[dict[str,str]], by default it will only return 100 posts maximum, though parameters can be given like in the initialize_table() function to return less, anyway, this is the relevant code and surrounding code within main.py:
```python
is_table_initialized = False

from sqlalchemy import MetaData, text, insert, select
from sqlalchemy.orm import Session
from database import engine
metadata_obj = MetaData()

from sqlalchemy import Table, Column, Integer, String
post_table = Table(
    "posts",
    metadata_obj,
    Column("id", Integer, primary_key=True, autoincrement=False),
)

# We get 1 post as a dummy to fill up the table
def initialize_table():
    global is_table_initialized

    if is_table_initialized:
        return
    
    posts = scrape_gelbooru(f"", limit=1, max_posts=1)
    print(f"Initializing Post Table...")
    for k in posts[0].keys():
        if k == 'id':
            continue

        post_table.append_column(Column(k, String)) # Could probably do some checking here for types

    metadata_obj.create_all(engine)
    
    is_table_initialized = True

# Now let's manipulate the DB
insert_stmt = text("INSERT INTO posts (:keys) VALUES (:values)")
select_stmt = text("SELECT * FROM posts")

@app.get("/gelbooru/scrape/")
async def gelbooru(tags: str = "sitting_on_lap 1girl 1boy", page: int = 0):
    initialize_table()

    posts = scrape_gelbooru(
        f"{tags} sort:score:desc", start_page=page, limit=100, max_pages=1
    )

    with Session(engine) as session:
        for post in posts:
            # result = session.execute(
            #     insert_stmt,
            #     {
            #         "keys": ", ".join([str(f"{k}") for k in post.keys()]),
            #         "values": ", ".join([str(f"{v}") for v in post.values()]),
            #     }
            # )
            stmt = insert(post_table).values(**post)
            session.execute(stmt)
        
        session.commit()

    return posts

@app.get("/gelbooru/get/")
async def gelbooru_get():
    initialize_table()

    with Session(engine) as session:
        # Assuming session is an instance of sqlalchemy.orm.Session
        stmt = select(post_table)  # Selects all columns from the ‘post_table’
        results = session.execute(stmt).fetchall()  # Fetch all the results

        # Convert the SQLAlchemy result set into a list of dictionaries
        posts_data = [dict(result) for result in results]
    
    return posts_data
```