S
Supabase10mo ago
Cavator

Unresolved attribute reference 'execute' for class 'BaseFilterRequestBuilder' on Python

i just want to understand why this warning show in this code when i execute after select it show's nothing, but when i put the .eq in the chain it shows this warning, anyone know how to solve it?
self.supabase_client.table('table')
.select('*')
.eq('id', id)
.execute()) <- show the warning Unresolved attribute reference 'execute' for class 'BaseFilterRequestBuilder'
self.supabase_client.table('table')
.select('*')
.eq('id', id)
.execute()) <- show the warning Unresolved attribute reference 'execute' for class 'BaseFilterRequestBuilder'
24 Replies
Cavator
CavatorOP10mo ago
this is my only import from supabase import create_client
silentworks
silentworks10mo ago
What version of the library are you using?
Cavator
CavatorOP10mo ago
2.10.0
silentworks
silentworks10mo ago
Give me a minute let me test that. What happens when you remove .eq()?
Cavator
CavatorOP10mo ago
it shows with no warnig
Cavator
CavatorOP10mo ago
No description
Cavator
CavatorOP10mo ago
i use pycharm, so idk if it's something with my intrepeter, but it's just a warning, everything works fine
silentworks
silentworks10mo ago
So the warning is only inside of your IDE? or does it happen at runtime too? Ah ok I would have to setup Pycharm to try it, but I don't get any warnings in VSCode with Pylance
Cavator
CavatorOP10mo ago
nono, just in the IDE, i'm using python 3.10 i'm opening my VSCode to see
Cavator
CavatorOP10mo ago
it doesn't show a warning, but u can see it does not understand the function it self
No description
Cavator
CavatorOP10mo ago
or i did something super wrong with my Python kkkk but all my projects run in a .venv so
silentworks
silentworks10mo ago
Your editor isn't picking up the .venv maybe. In VS Code you can select the .venv at the bottom where it shows the python version.
silentworks
silentworks10mo ago
Cavator
CavatorOP10mo ago
i think i see the problem, mine it's calling the base_request_builder, you is calling the async/request_builder, could be it
No description
silentworks
silentworks10mo ago
Mine wouldn't be doing something different to yours when its the same library we are using. Don't look at the file I had opened, I was just investigating something.
Cavator
CavatorOP10mo ago
but my .venv it's setup correctly in the IDEs
silentworks
silentworks10mo ago
It's best to create a minimal reproducible example repo to show the issue as I'm not able to reproduce it. If the code works at runtime, then its an editor setup issue.
Cavator
CavatorOP10mo ago
i did it, and this it's why i'm getting this warning
No description
Cavator
CavatorOP10mo ago
No description
Cavator
CavatorOP10mo ago
the execute does not exist in the BaseFilterRequestBuilder and idk what could be wrong with the interpretor of the IDE's, bacause the two are showing some type of warning, the VSCode does not show a explict warning but it doesn't understand the function .execute after the .eq
silentworks
silentworks10mo ago
Now I'm curious as I don't get this issue in VS Code. PyCharm installing at the moment.
No description
silentworks
silentworks10mo ago
Yeah PyCharm is showing me the same warning as what you are getting.
silentworks
silentworks10mo ago
@Cavator open an issue on the https://github.com/supabase/supabase-py repo and I'll take a look at improving this in the future. Thanks for catching this warning.
GitHub
GitHub - supabase/supabase-py: Python Client for Supabase. Query Po...
Python Client for Supabase. Query Postgres from Flask, Django, FastAPI. Python user authentication, security policies, edge functions, file storage, and realtime data streaming. Good first issue. -...
KBe
KBe9mo ago
Hi. I'm getting the same warning with the create_async_client function (using PyCharm w/ Poetry, supabase v2.11.0 and Python 3.13). Exploring the source of "eq" I figured out the class BaseFilterRequestBuilder doesn't have a definition for the execute method and doesn't extend any class which define it. In fact, there is no definition in the whole base_request_builder.py file (word search). This is why PyCharm is showing a warning. Example:
from supabase import create_async_client

from app.env import env_vars

# ...

supabase = await create_async_client(
supabase_url=env_vars['SUPABASE_URL'],
supabase_key=env_vars['SUPABASE_KEY'],
)

full = await supabase.schema('stuff').table('registries').select().execute()

# The following line is generating the warning
partial = await supabase.schema('stuff').table('registries').eq('key', key).execute()

# ...
from supabase import create_async_client

from app.env import env_vars

# ...

supabase = await create_async_client(
supabase_url=env_vars['SUPABASE_URL'],
supabase_key=env_vars['SUPABASE_KEY'],
)

full = await supabase.schema('stuff').table('registries').select().execute()

# The following line is generating the warning
partial = await supabase.schema('stuff').table('registries').eq('key', key).execute()

# ...
The select method is currently defined in the class AsyncRequestBuilder and returns an instance of the AsyncSelectRequestBuilder class which extends the AsyncQueryRequestBuilder which is currently defining the execute method. Something similar is happening with the single() method. While the Node SDK can execute, for example, a select(...).eq(...).single() chain, Python API doesn't. I hope this help to fix the issue

Did you find this page helpful?