File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 7
7
from datacube .index import Index
8
8
from datacube .model import Dataset , MetadataType , Product , Range
9
9
from datacube .model .fields import Field
10
- from sqlalchemy import Result , Row , Select
10
+ from sqlalchemy import CursorResult , Result , Row , Select
11
11
from sqlalchemy .sql import ColumnElement
12
12
from sqlalchemy .sql .elements import ClauseElement , Label
13
13
@@ -150,10 +150,10 @@ def upsert_product_record(
150
150
) -> tuple [int , datetime ]: ...
151
151
152
152
@abstractmethod
153
- def upsert_product_regions (self , product_id : int ) -> Result : ...
153
+ def upsert_product_regions (self , product_id : int ) -> CursorResult : ...
154
154
155
155
@abstractmethod
156
- def delete_product_empty_regions (self , product_id : int ) -> Result : ...
156
+ def delete_product_empty_regions (self , product_id : int ) -> CursorResult : ...
157
157
158
158
@abstractmethod
159
159
def product_region_summary (self , product_id : int ) -> Result : ...
Original file line number Diff line number Diff line change 19
19
from geoalchemy2 .shape import from_shape
20
20
from sqlalchemy import (
21
21
ClauseElement ,
22
+ CursorResult ,
22
23
Integer ,
23
24
Label ,
24
25
Result ,
@@ -300,7 +301,7 @@ def product_summary_cols(self, product_name: str) -> Row:
300
301
).fetchone ()
301
302
302
303
@override
303
- def upsert_product_regions (self , product_id : int ) -> Result :
304
+ def upsert_product_regions (self , product_id : int ) -> CursorResult :
304
305
# add new regions row and/or update existing regions based on dataset_spatial
305
306
with self .index ._active_connection () as conn :
306
307
return conn .execute (
@@ -336,7 +337,7 @@ def upsert_product_regions(self, product_id: int) -> Result:
336
337
)
337
338
338
339
@override
339
- def delete_product_empty_regions (self , product_id : int ) -> Result :
340
+ def delete_product_empty_regions (self , product_id : int ) -> CursorResult :
340
341
with self .index ._active_connection () as conn :
341
342
return conn .execute (
342
343
text (f"""
Original file line number Diff line number Diff line change 21
21
from geoalchemy2 .shape import from_shape
22
22
from sqlalchemy import (
23
23
ClauseElement ,
24
+ CursorResult ,
24
25
Integer ,
25
26
Label ,
26
27
Result ,
@@ -316,7 +317,7 @@ def product_summary_cols(self, product_name: str) -> Row:
316
317
).fetchone ()
317
318
318
319
@override
319
- def upsert_product_regions (self , product_id : int ) -> Result :
320
+ def upsert_product_regions (self , product_id : int ) -> CursorResult :
320
321
# add new regions row and/or update existing regions based on dataset_spatial
321
322
with self .index ._active_connection () as conn :
322
323
return conn .execute (
@@ -352,7 +353,7 @@ def upsert_product_regions(self, product_id: int) -> Result:
352
353
)
353
354
354
355
@override
355
- def delete_product_empty_regions (self , product_id : int ) -> Result :
356
+ def delete_product_empty_regions (self , product_id : int ) -> CursorResult :
356
357
with self .index ._active_connection () as conn :
357
358
return conn .execute (
358
359
text (f"""
You can’t perform that action at this time.
0 commit comments