I am currently testing an application locally, I have decided it would be best to store and access necessary data through supabase. I am using the most updated streamlit and python versions that are compatible (I reinstalled them both recently). I essentially copied the code from the docs to test pulling data:
import streamlit as st
from st_supabase_connection import SupabaseConnection
# Initialize connection.
conn = st.connection("supabase", type=SupabaseConnection)
# Perform query.
response = conn.query("*", table="routes", ttl="10m").execute()
# Print results.
if response and response.data:
for row in response.data:
st.write(f"{row['name']} has a :{row['pet']}:")
else:
st.write("No data retrieved or query failed.")
but I am getting this error and cant seem to figure it out:
AttributeError: ‘SupabaseConnection’ object has no attribute ‘query’
2024-06-10 14:37:59.003 Uncaught app exception
Traceback (most recent call last):
File “/Users/G*/anaconda3/envs/DATA/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 600, in _run_script
exec(code, module.dict)
File “/Users/Gd/Desktop/Streamline maps/MapManagerBozemanTransport/pages/3_test_supabase.py", line 8, in
response = conn.query("”, table=“routes”, ttl=“10m”).execute()
^^^^^^^^^^
File “/Users/G*/anaconda3/envs/DATA/lib/python3.11/site-packages/streamlit/connections/base_connection.py”, line 86, in getattribute
raise e
File “/Users/G*/anaconda3/envs/DATA/lib/python3.11/site-packages/streamlit/connections/base_connection.py”, line 80, in getattribute
return object.getattribute(self, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: ‘SupabaseConnection’ object has no attribute ‘query’