We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10427c8 commit e5e1918Copy full SHA for e5e1918
pysimplesql/pysimplesql.py
@@ -1386,7 +1386,7 @@ def set_by_pk(
1386
1387
# Move to the numerical index of where the primary key is located.
1388
# If the pk value can't be found, move to the last index
1389
- idx = self.rows.sort_index().index[self.rows[self.pk_column] == pk].tolist()
+ idx = [i for i, value in enumerate(self.rows[self.pk_column]) if value == pk]
1390
idx = idx[0] if idx else len(self.rows.index)
1391
self.current_index = idx
1392
0 commit comments