Caching fails on rerun and throws "ValueError: not enough values to unpack"

Hi Streamlit community,

I hope you can help. I’m building an app that queries a Neo4j graph database. I’d like it to cache the results of a query. Here is an example of my function:

def run_query(cypher):
    result = conn.query(cypher)
    return result

Without the decorator, the function works perfectly. With it, however, it runs the first time, but when I rerun it, I get this error message: “ValueError: not enough values to unpack (expected 2, got 1)”.

I would appreciate any thoughts on what could be causing this.

Thank you in advance.