Spaces:
Sleeping
Sleeping
James McCool
commited on
Commit
·
4162581
1
Parent(s):
f8485d4
Add debug print statements in create_position_export_dict function in app.py to log position filters and filtered DataFrames, aiding in troubleshooting and data validation during export dictionary generation.
Browse files
app.py
CHANGED
|
@@ -42,6 +42,8 @@ def create_position_export_dict(column_name, csv_file):
|
|
| 42 |
import re
|
| 43 |
position_filter = re.sub(r'\d+', '', column_name)
|
| 44 |
|
|
|
|
|
|
|
| 45 |
# Filter CSV file by position
|
| 46 |
if 'Position' in csv_file.columns:
|
| 47 |
filtered_df = csv_file[
|
|
@@ -55,10 +57,12 @@ def create_position_export_dict(column_name, csv_file):
|
|
| 55 |
|
| 56 |
try:
|
| 57 |
filtered_df = filtered_df.sort_values(by='Salary', ascending=False).drop_duplicates(subset=['Name'])
|
|
|
|
| 58 |
return dict(zip(filtered_df['Name'], filtered_df['Name + ID']))
|
| 59 |
except:
|
| 60 |
try:
|
| 61 |
filtered_df = filtered_df.sort_values(by='Salary', ascending=False).drop_duplicates(subset=['Nickname'])
|
|
|
|
| 62 |
return dict(zip(filtered_df['Nickname'], filtered_df['Id']))
|
| 63 |
except:
|
| 64 |
# Final fallback
|
|
|
|
| 42 |
import re
|
| 43 |
position_filter = re.sub(r'\d+', '', column_name)
|
| 44 |
|
| 45 |
+
print(position_filter)
|
| 46 |
+
|
| 47 |
# Filter CSV file by position
|
| 48 |
if 'Position' in csv_file.columns:
|
| 49 |
filtered_df = csv_file[
|
|
|
|
| 57 |
|
| 58 |
try:
|
| 59 |
filtered_df = filtered_df.sort_values(by='Salary', ascending=False).drop_duplicates(subset=['Name'])
|
| 60 |
+
print(filtered_df)
|
| 61 |
return dict(zip(filtered_df['Name'], filtered_df['Name + ID']))
|
| 62 |
except:
|
| 63 |
try:
|
| 64 |
filtered_df = filtered_df.sort_values(by='Salary', ascending=False).drop_duplicates(subset=['Nickname'])
|
| 65 |
+
print(filtered_df)
|
| 66 |
return dict(zip(filtered_df['Nickname'], filtered_df['Id']))
|
| 67 |
except:
|
| 68 |
# Final fallback
|