@@ -1966,7 +1966,7 @@ def duplicate_record(
1966
1966
self .frm .popup .ok (
1967
1967
lang .duplicate_failed_title ,
1968
1968
lang .duplicate_failed .format_map (
1969
- LangFormat (exception = result .exception )
1969
+ LangFormat (exception = result .attrs [ " exception" ] )
1970
1970
),
1971
1971
)
1972
1972
else :
@@ -7530,7 +7530,7 @@ def execute(
7530
7530
7531
7531
lastrowid = cursor .rowcount if cursor .rowcount else None
7532
7532
7533
- return pd . DataFrame (
7533
+ return Result . set (
7534
7534
[
7535
7535
dict (zip ([column [0 ] for column in cursor .description ], row ))
7536
7536
for row in rows
@@ -7758,10 +7758,10 @@ def execute(
7758
7758
row [column_name ] = value
7759
7759
rows .append (row )
7760
7760
7761
- return pd . DataFrame (rows , None , exception , column_info )
7761
+ return Result . set (rows , None , exception , column_info )
7762
7762
7763
7763
affected_rows = stmt .getUpdateCount ()
7764
- return pd . DataFrame ([], affected_rows , exception , column_info )
7764
+ return Result . set ([], affected_rows , exception , column_info )
7765
7765
7766
7766
def column_info (self , table ):
7767
7767
meta_data = self .con .getMetaData ()
@@ -7852,7 +7852,9 @@ def relationships(self):
7852
7852
7853
7853
def max_pk (self , table : str , pk_column : str ) -> int :
7854
7854
rows = self .execute (f"SELECT MAX({ pk_column } ) as max_pk FROM { table } " )
7855
- return rows .fetchone ()["MAX_PK" ] # returned as upper case
7855
+
7856
+ for _ , row in rows .iterrows ():
7857
+ return row ["MAX_PK" ] # returned as upper case
7856
7858
7857
7859
def _get_column_definitions (self , table_name ):
7858
7860
# Creates a comma separated list of column names and types to be used in a
@@ -7898,11 +7900,11 @@ def duplicate_record(self, dataset: DataSet, children: bool) -> pd.DataFrame:
7898
7900
]
7899
7901
for q in query :
7900
7902
res = self .execute (q )
7901
- if res .exception :
7903
+ if res .attrs [ " exception" ] :
7902
7904
return res
7903
7905
7904
7906
# Now we save the new pk
7905
- pk = res .lastrowid
7907
+ pk = res .attrs [ " lastrowid" ]
7906
7908
7907
7909
# create list of which children we have duplicated
7908
7910
child_duplicated = []
@@ -7943,7 +7945,7 @@ def duplicate_record(self, dataset: DataSet, children: bool) -> pd.DataFrame:
7943
7945
]
7944
7946
for q in queries :
7945
7947
res = self .execute (q )
7946
- if res .exception :
7948
+ if res .attrs [ " exception" ] :
7947
7949
return res
7948
7950
7949
7951
child_duplicated .append (r .child_table )
0 commit comments