graph_generator / data_loader.py
juancamval's picture
Update data_loader.py
487ed3a verified
raw
history blame
754 Bytes
#Aqui añadiremos la conexion entre Supabase y Huggingface
import pandas as pd
from supabase import create_client, Client
#Aqui van las credenciales, conectar las credenciales de Supabase en "Secrets"
Class DataLoader():
#SUPABASE_URL =
#SUPABASE_KEY =
def load_data():
"""fertility, geo data, labor, population y predictions """
try:
response = supabase.from_("LabourForecast").execute()
if response.error:
st.error(f"Error fetching data: {response.error}")
return pd.DataFrame()
else:
return pd.DataFrame(response.data)
except Exception as e:
st.error(f"An error occurred: {e}")
return pd.DataFrame()