@@ -3010,7 +3010,7 @@ def build_insert_queries_and_params(
30103010 extracts = resolve_extracts (extracts )
30113011
30123012 # Build a row-list ready for executemany-style flattening
3013- values : List [ list ] = []
3013+ values = []
30143014
30153015 for record in chunk :
30163016 record_values = []
@@ -3085,7 +3085,7 @@ def build_insert_queries_and_params(
30853085
30863086 # At this point we need compatibility UPSERT for SQLite < 3.24.0
30873087 # (INSERT OR IGNORE + second UPDATE stage)
3088- queries_and_params : list [ tuple [ str , list ]] = []
3088+ queries_and_params = []
30893089
30903090 insert_sql = (
30913091 f"INSERT OR IGNORE INTO [{ self .name } ] "
@@ -3118,7 +3118,7 @@ def build_insert_queries_and_params(
31183118 )
31193119
31203120 # Parameters for the UPDATE – pk cols first then non-pk cols
3121- update_params : list = []
3121+ update_params = []
31223122 for row in values :
31233123 row_dict = dict (zip (all_columns , row ))
31243124 ordered = [row_dict [c ] for c in pk_cols + non_pk_cols ]
@@ -3417,7 +3417,7 @@ def insert_all(
34173417 # If we only handled a single row populate self.last_pk
34183418 if num_records_processed == 1 :
34193419 # For an insert we need to use result.lastrowid
3420- if not upsert :
3420+ if not upsert and result is not None :
34213421 self .last_rowid = result .lastrowid
34223422 if (hash_id or pk ) and self .last_rowid :
34233423 # Set self.last_pk to the pk(s) for that rowid
0 commit comments