SR05 commited on
Commit
2e43978
·
verified ·
1 Parent(s): 43acd05

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +16 -6
main.py CHANGED
@@ -14,6 +14,11 @@ if st.button("Go to backup link"):
14
  # Title of the app
15
  st.title("Visa Application Search")
16
 
 
 
 
 
 
17
  # **Search Application by Number**
18
  application_number = st.text_input("Enter Application Number:")
19
  search_button = st.button("Search")
@@ -21,12 +26,17 @@ search_button = st.button("Search")
21
  if search_button:
22
  # Perform search
23
  if application_number and application_number.strip():
24
- result_df = precomputed_df[precomputed_df["Application Number"] == application_number.strip()]
25
- if not result_df.empty:
26
- st.write("### Search Result:")
27
- st.dataframe(result_df)
28
- else:
29
- st.warning("No results found.")
 
 
 
 
 
30
  else:
31
  st.warning("Please enter a valid application number.")
32
 
 
14
  # Title of the app
15
  st.title("Visa Application Search")
16
 
17
+ # Debugging: Show Data Preview
18
+ if not precomputed_df.empty:
19
+ st.write("### Debugging: Data Loaded")
20
+ st.dataframe(precomputed_df.head(10)) # Display first 10 rows
21
+
22
  # **Search Application by Number**
23
  application_number = st.text_input("Enter Application Number:")
24
  search_button = st.button("Search")
 
26
  if search_button:
27
  # Perform search
28
  if application_number and application_number.strip():
29
+ try:
30
+ application_number = int(application_number.strip()) # Convert input to integer
31
+ result_df = precomputed_df[precomputed_df["Application Number"] == application_number]
32
+
33
+ if not result_df.empty:
34
+ st.write("### Search Result:")
35
+ st.dataframe(result_df)
36
+ else:
37
+ st.warning("No results found.")
38
+ except ValueError:
39
+ st.warning("Please enter a valid numeric application number.")
40
  else:
41
  st.warning("Please enter a valid application number.")
42