Skip to content

Commit d1f11bd

Browse files
committed
refs #281, Pandas partially working
More cleanup and experimentation. There is an issue with saving where sometimes the dict gets an extra key "0" and the update query fails. Also, even at times that the query goes through, the DataSet does not seem to update immediately to show the difference
1 parent 0cc1f13 commit d1f11bd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/SQLite_examples/Journal.db

0 Bytes
Binary file not shown.

pysimplesql/pysimplesql.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
import threading # threaded popup
6565
from datetime import date, datetime
6666
from time import sleep, time # threaded popup
67-
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, TypedDict, Union
67+
from typing import Callable, Dict, List, Optional, Tuple, Type, TypedDict, Union
6868

6969
import pandas as pd
7070
import PySimpleGUI as sg
@@ -5868,7 +5868,7 @@ def __init__(
58685868
:column_info: a `ColumnInfo` object can be supplied so that column information
58695869
can be accessed
58705870
"""
5871-
super().__init__(rows)
5871+
super().__init__(rows) # initialize the DataFrame with the row values
58725872
self.lastrowid = lastrowid
58735873
self.exception = exception
58745874
self.column_info = column_info
@@ -5912,7 +5912,7 @@ def insert(self, row: dict, idx: int = None, virtual: bool = False) -> None:
59125912
"""
59135913
row_series = pd.Series(row)
59145914
if idx is None:
5915-
idx = len(self)
5915+
idx = len(self.index)
59165916
idx_label = self.index.max() + 1 if len(self) > 0 else 0
59175917
self.loc[idx_label] = row_series
59185918
self.attrs["original_index"] = self.attrs["original_index"].insert(

0 commit comments

Comments
 (0)