juancamval commited on
Commit
487ed3a
·
verified ·
1 Parent(s): 3474dba

Update data_loader.py

Browse files
Files changed (1) hide show
  1. data_loader.py +15 -13
data_loader.py CHANGED
@@ -5,18 +5,20 @@ from supabase import create_client, Client
5
 
6
  #Aqui van las credenciales, conectar las credenciales de Supabase en "Secrets"
7
 
8
- #SUPABASE_URL =
9
- #SUPABASE_KEY =
10
 
11
- def load_data():
12
- """fertility, geo data, labor, population y predictions """
13
- try:
14
- response = supabase.from_("LabourForecast").execute()
15
- if response.error:
16
- st.error(f"Error fetching data: {response.error}")
 
 
 
 
 
 
 
 
17
  return pd.DataFrame()
18
- else:
19
- return pd.DataFrame(response.data)
20
- except Exception as e:
21
- st.error(f"An error occurred: {e}")
22
- return pd.DataFrame()
 
5
 
6
  #Aqui van las credenciales, conectar las credenciales de Supabase en "Secrets"
7
 
8
+ Class DataLoader():
 
9
 
10
+ #SUPABASE_URL =
11
+ #SUPABASE_KEY =
12
+
13
+ def load_data():
14
+ """fertility, geo data, labor, population y predictions """
15
+ try:
16
+ response = supabase.from_("LabourForecast").execute()
17
+ if response.error:
18
+ st.error(f"Error fetching data: {response.error}")
19
+ return pd.DataFrame()
20
+ else:
21
+ return pd.DataFrame(response.data)
22
+ except Exception as e:
23
+ st.error(f"An error occurred: {e}")
24
  return pd.DataFrame()