Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -122,8 +122,12 @@ def generate_full_schedule(creators_file, overnight_file, day_file, prime_file):
|
|
| 122 |
for idx, chatter_df in enumerate(chatter_files):
|
| 123 |
print(f"DEBUG: Chatter File {idx + 1} Columns:", chatter_df.columns)
|
| 124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
# Validate data structure
|
| 126 |
-
required_creator_columns = {"
|
| 127 |
if not required_creator_columns.issubset(creators_data.columns):
|
| 128 |
return f"Error: Creators file must contain the columns {required_creator_columns}."
|
| 129 |
|
|
@@ -134,6 +138,7 @@ def generate_full_schedule(creators_file, overnight_file, day_file, prime_file):
|
|
| 134 |
return f"Error generating schedule: {e}"
|
| 135 |
|
| 136 |
|
|
|
|
| 137 |
# Gradio Interface
|
| 138 |
def app():
|
| 139 |
with gr.Blocks() as interface:
|
|
|
|
| 122 |
for idx, chatter_df in enumerate(chatter_files):
|
| 123 |
print(f"DEBUG: Chatter File {idx + 1} Columns:", chatter_df.columns)
|
| 124 |
|
| 125 |
+
# Rename "Creator" to "Account" to match the expected column in the schedule function
|
| 126 |
+
if "Creator" in creators_data.columns:
|
| 127 |
+
creators_data.rename(columns={"Creator": "Account"}, inplace=True)
|
| 128 |
+
|
| 129 |
# Validate data structure
|
| 130 |
+
required_creator_columns = {"Account", "ActiveFans"}
|
| 131 |
if not required_creator_columns.issubset(creators_data.columns):
|
| 132 |
return f"Error: Creators file must contain the columns {required_creator_columns}."
|
| 133 |
|
|
|
|
| 138 |
return f"Error generating schedule: {e}"
|
| 139 |
|
| 140 |
|
| 141 |
+
|
| 142 |
# Gradio Interface
|
| 143 |
def app():
|
| 144 |
with gr.Blocks() as interface:
|