Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -165,7 +165,7 @@ def quote_year_choices():
|
|
165 |
|
166 |
def quote_month_choices(year=None):
|
167 |
"""
|
168 |
-
Returns a sorted list of valid month strings for a given year,
|
169 |
"""
|
170 |
df = get_quotes_df()
|
171 |
if (
|
@@ -177,8 +177,9 @@ def quote_month_choices(year=None):
|
|
177 |
subset = df[df["Year"].astype(str) == str(year)]
|
178 |
try:
|
179 |
months = pd.to_numeric(subset["Month"], errors="coerce").dropna().astype(int)
|
180 |
-
months =
|
181 |
-
|
|
|
182 |
except Exception:
|
183 |
return [""]
|
184 |
return [""]
|
|
|
165 |
|
166 |
def quote_month_choices(year=None):
|
167 |
"""
|
168 |
+
Returns a sorted list of valid month strings for a given year, always at least [''].
|
169 |
"""
|
170 |
df = get_quotes_df()
|
171 |
if (
|
|
|
177 |
subset = df[df["Year"].astype(str) == str(year)]
|
178 |
try:
|
179 |
months = pd.to_numeric(subset["Month"], errors="coerce").dropna().astype(int)
|
180 |
+
months = [str(m) for m in months if 1 <= m <= 12]
|
181 |
+
months = sorted(set(months))
|
182 |
+
return [""] + months if months else [""]
|
183 |
except Exception:
|
184 |
return [""]
|
185 |
return [""]
|