@@ -1037,7 +1037,6 @@ def requery(
1037
1037
# Strip trailing white space, as this is what sg[element].get() does, so we
1038
1038
# can have an equal comparison. Not the prettiest solution. Will look into
1039
1039
# this more on the PySimpleGUI end and make a follow-up ticket.
1040
-
1041
1040
# TODO: Is the [:,:] still needed now that we are working with DateFrames?
1042
1041
self .rows .loc [:, :] = self .rows .applymap (
1043
1042
lambda x : x .rstrip () if isinstance (x , str ) else x
@@ -1586,7 +1585,6 @@ def save_record(
1586
1585
:returns: SAVE_NONE, SAVE_FAIL or SAVE_SUCCESS masked with SHOW_MESSAGE
1587
1586
"""
1588
1587
logger .debug (f"Saving records for table { self .table } ..." )
1589
-
1590
1588
if display_message is None :
1591
1589
display_message = not self .save_quiet
1592
1590
@@ -6919,7 +6917,7 @@ def save_record(
6919
6917
6920
6918
# Update the DataSet object's DataFra,e with the changes, so then
6921
6919
# the entire DataFrame can be written back to file sequentially
6922
- dataset .rows [dataset .current_index ] = changed_row
6920
+ dataset .rows . iloc [dataset .current_index ] = pd . Series ( changed_row )
6923
6921
6924
6922
# open the CSV file for writing
6925
6923
with open (self .file_path , "w" , newline = "\n " ) as csvfile :
@@ -6932,15 +6930,14 @@ def save_record(
6932
6930
# Write out the stored pre_header lines
6933
6931
for line in self .pre_header :
6934
6932
writer .writerow (line )
6935
-
6936
6933
# write the header row
6937
6934
writer .writerow (list (self .columns ))
6938
6935
6939
6936
# write the DataFrame out.
6940
6937
# Use our columns to exclude the possible virtual pk
6941
6938
rows = []
6942
- for r in dataset .rows :
6943
- rows .append ([r [c ] for c in self .columns ])
6939
+ for index , row in dataset .rows . iterrows () :
6940
+ rows .append ([row [c ] for c in self .columns ])
6944
6941
6945
6942
logger .debug (f"Writing the following data to { self .file_path } " )
6946
6943
logger .debug (rows )
0 commit comments