From e17e9831fcfbef0d9a0511229ba94e5de22d676e Mon Sep 17 00:00:00 2001 From: Colin Blackburn Date: Thu, 14 Sep 2023 09:46:43 +0100 Subject: [PATCH] Use Collection over Sequence --- etlhelper/etl.py | 3 +-- etlhelper/types.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/etlhelper/etl.py b/etlhelper/etl.py index cc88fe2..2b4ba35 100644 --- a/etlhelper/etl.py +++ b/etlhelper/etl.py @@ -16,7 +16,6 @@ Iterator, NamedTuple, Optional, - Sequence, Union, ) @@ -324,7 +323,7 @@ def _execute_by_row( query: str, conn: Connection, chunk: Chunk - ) -> Sequence[NamedTuple]: + ) -> list[NamedTuple]: """ Retry execution of rows individually and return failed rows along with their errors. Successful inserts are committed. This is because diff --git a/etlhelper/types.py b/etlhelper/types.py index 0ca037b..01909ae 100644 --- a/etlhelper/types.py +++ b/etlhelper/types.py @@ -1,7 +1,7 @@ from typing import ( Any, + Collection, Protocol, - Sequence, ) @@ -19,5 +19,5 @@ def cursor(self): # noqa Cursor Protocol not defined ... -Row = Sequence[Any] +Row = Collection[Any] Chunk = list[Row]