Multiple metadata filters not working

When I hardcode my filters, everything works fine. When I put in variables, my filter always returns empty. Am I going about this wrong?

if ‘query’ in data: # Check if the request contains a ‘query’ field
query = data[‘query’]
# Capture the namespace
namespace_query = data.get(‘namespace_query’)
# Capture company name, type, story, and client name if they are provided in the request data
company_query = [data[‘company_query’]
] if ‘company_query’ in data else
type_query = [data[‘type_query’]] if ‘type_query’ in data else
story_query = [data[‘story_query’]] if ‘story_query’ in data else
client_query = [data[‘client_query’]] if ‘client_query’ in data else

    my_inp_embed = get_embedding(query, engine="text-embedding-ada-002")

    # Define the filter for the Pinecone query
    filter = {}

    if company_query[0]:
        filter["company name"] = {"$in": company_query}
    if type_query[0]:
        filter["type of story"] = {"$in": type_query}
    if story_query[0]:
        filter["story title"] = {"$in": story_query}
    if client_query[0]:
        filter["client name"] = {"$in": client_query}

    print(f"Using filter: {filter}")  # print out the filter for debugging

    res = index.query(
    ) ; My HTML matches up, I've debugged every possible way, but my filter is always empty.