Skip to content

Commit fb434e0

Browse files
committed
google_export: sorting bug fix
1 parent c8813b2 commit fb434e0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

google_export/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def write_to_local_csv(awards: dict[set], curl_args, fname: str = 'result.csv',
131131

132132
for user_awards in awards.values():
133133
column_names.update(user_awards)
134-
column_names = default_columns + list(column_names)
134+
column_names = default_columns + sorted(list(column_names))
135135
with open(fname, 'w', newline='') as csvfile:
136136
award_writer = csv.writer(csvfile)
137137
award_writer.writerow(

google_export/sheets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ def cut_lines(lines: [str], skip=0):
2828

2929

3030
def write_data_to_table(df_data, google_token, table_id, sheet_id):
31+
df_data = df_data.sort_values(by='Joined the Google Developer Program')
32+
3133
if google_token and sheet_id and table_id:
3234
gc = pygsheets.authorize(service_file=google_token)
3335
sh = gc.open_by_key(table_id)

0 commit comments

Comments
 (0)