Open awilhelm-projects opened 1 month ago
To resolve the SyntaxWarning: invalid escape sequence '\*'
in the metadata_filter.py
file, you can change the docstring to a raw string by prefixing it with r
. This prevents Python from interpreting backslashes as escape characters.
Here's the fix:
From:
class MetadataFilter(pydantic.BaseModel):
"""
Comprehensive metadata filter for vector stores to support more operators.
"""
To:
class MetadataFilter(pydantic.BaseModel):
r"""
Comprehensive metadata filter for vector stores to support more operators.
"""
This change will prevent the invalid escape sequence warning.
To continue talking to Dosu, mention @dosu.
Hello, has this issue been solved?
I'm getting the same warning, and this is affecting a part of my app. I'm not able to visit some endpoints of my API. The feedback I'm getting is:
TypeError at /api/docs/
startswith first arg must be str or a tuple of str, not NoneType
...but this, I believe, is because of this warning I get when my app is running in production:
/python/lib/python3.12/site-packages/llama_cloud/types/metadata_filter.py:20: SyntaxWarning: invalid escape sequence '\*'
I already tried removing the llama_cloud package since my app didn't really use it (or so I thought) but I noticed that llamaindex
wasn't running without the llama_cloud
package so had to reinstall it
Surprisingly, everything works in my local environment and I'm able to access all endpoints. The error doesn't even show locally but once I deploy to production, I get the SyntaxWarning and the endpoints begin showing the TypeError
Any help?
Bug Description
I got this warning - and it is simple to solve:
Version
0.10.45
Steps to Reproduce
Just use Llama Index.
Relevant Logs/Tracbacks