Spaces:
Build error
Build error
Commit
·
a17d0ff
1
Parent(s):
6b58ffb
Update app.py
Browse files
app.py
CHANGED
@@ -167,6 +167,7 @@ else:
|
|
167 |
csv_file = st.file_uploader("Upload a CSV file", type=["csv"])
|
168 |
|
169 |
# Display the schema if an existing class is selected
|
|
|
170 |
if selected_class != "New Class":
|
171 |
st.write(f"Schema for {selected_class}:")
|
172 |
class_schema = get_class_schema(selected_class)
|
@@ -176,7 +177,7 @@ if selected_class != "New Class":
|
|
176 |
st.table(schema_df[["name", "dataType"]]) # Display only the name and dataType columns
|
177 |
|
178 |
# Before ingesting data into Weaviate, check if CSV columns match the class schema
|
179 |
-
if csv_file is not None:
|
180 |
data = csv_file.read().decode("utf-8")
|
181 |
dataframe = pd.read_csv(StringIO(data))
|
182 |
|
|
|
167 |
csv_file = st.file_uploader("Upload a CSV file", type=["csv"])
|
168 |
|
169 |
# Display the schema if an existing class is selected
|
170 |
+
class_schema = None # Initialize class_schema to None
|
171 |
if selected_class != "New Class":
|
172 |
st.write(f"Schema for {selected_class}:")
|
173 |
class_schema = get_class_schema(selected_class)
|
|
|
177 |
st.table(schema_df[["name", "dataType"]]) # Display only the name and dataType columns
|
178 |
|
179 |
# Before ingesting data into Weaviate, check if CSV columns match the class schema
|
180 |
+
if csv_file is not None and class_schema: # Ensure class_schema is not None
|
181 |
data = csv_file.read().decode("utf-8")
|
182 |
dataframe = pd.read_csv(StringIO(data))
|
183 |
|