Skip to content

Commit d885dc8

Browse files
committed
Auto format and sort imports
1 parent a30de15 commit d885dc8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

psqlextra/manager/manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from typing import Dict, List, Tuple, Union, Iterable
21
from itertools import chain
2+
from typing import Dict, Iterable, List, Tuple, Union
33

44
import django
55

@@ -323,7 +323,7 @@ def bulk_upsert(
323323
A list of either the dicts of the rows upserted, including the pk or
324324
the models of the rows upserted
325325
"""
326-
is_empty = lambda r: all([False for _ in r])
326+
def is_empty(r): return all([False for _ in r])
327327
if not rows or is_empty(rows):
328328
return []
329329

tests/test_upsert.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def test_bulk_upsert_accepts_getitem_iterable():
155155
class GetItemIterable:
156156
def __init__(self, items):
157157
self.items = items
158+
158159
def __getitem__(self, key):
159160
return self.items[key]
160161

@@ -183,6 +184,7 @@ def test_bulk_upsert_accepts_iter_iterable():
183184
class IterIterable:
184185
def __init__(self, items):
185186
self.items = items
187+
186188
def __iter__(self):
187189
return iter(self.items)
188190

0 commit comments

Comments
 (0)