gkdivya commited on
Commit
66b4504
·
verified ·
1 Parent(s): b0894d3

Update searchschool.py

Browse files
Files changed (1) hide show
  1. searchschool.py +4 -4
searchschool.py CHANGED
@@ -149,7 +149,7 @@ def get_school_rows_by_udise(
149
  # ====================================================
150
  def search_candidates(
151
  query_name: str,
152
- state_key: str | None,
153
  district: str | None,
154
  block: str | None,
155
  village: str | None = None,
@@ -167,8 +167,8 @@ def search_candidates(
167
  df = master_df
168
 
169
  # -------- Filters --------
170
- if state_key:
171
- df = df[df[MASTER_STATE_COL].str.upper() == state_key.upper()]
172
 
173
  if district:
174
  df = df[df[MASTER_DISTRICT_COL] == district]
@@ -182,7 +182,7 @@ def search_candidates(
182
  if df.empty:
183
  return pd.DataFrame(), pd.DataFrame()
184
 
185
- state_for_patterns = (state_key or DEFAULT_STATE_KEY).upper()
186
 
187
  choices = df[MASTER_SCHOOL_COL].astype(str)
188
 
 
149
  # ====================================================
150
  def search_candidates(
151
  query_name: str,
152
+ state: str | None,
153
  district: str | None,
154
  block: str | None,
155
  village: str | None = None,
 
167
  df = master_df
168
 
169
  # -------- Filters --------
170
+ if state:
171
+ df = df[df[MASTER_STATE_COL].str.upper() == state.upper()]
172
 
173
  if district:
174
  df = df[df[MASTER_DISTRICT_COL] == district]
 
182
  if df.empty:
183
  return pd.DataFrame(), pd.DataFrame()
184
 
185
+ state_for_patterns = (state or DEFAULT_STATE_KEY).upper()
186
 
187
  choices = df[MASTER_SCHOOL_COL].astype(str)
188