Remove duplicate function
This commit is contained in:
parent
37c0f87d10
commit
07ef8d22c1
@ -1,7 +1,6 @@
|
|||||||
from hashlib import sha1
|
from hashlib import sha1
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from collections.abc import Iterable
|
|
||||||
from sqlalchemy.exc import ResourceClosedError
|
from sqlalchemy.exc import ResourceClosedError
|
||||||
|
|
||||||
QUERY_STEP = 1000
|
QUERY_STEP = 1000
|
||||||
@ -110,15 +109,6 @@ def index_name(table, columns):
|
|||||||
return 'ix_%s_%s' % (table, key)
|
return 'ix_%s_%s' % (table, key)
|
||||||
|
|
||||||
|
|
||||||
def ensure_tuple(obj):
|
|
||||||
"""Try and make the given argument into a tuple."""
|
|
||||||
if obj is None:
|
|
||||||
return tuple()
|
|
||||||
if isinstance(obj, Iterable) and not isinstance(obj, (str, bytes)):
|
|
||||||
return tuple(obj)
|
|
||||||
return obj,
|
|
||||||
|
|
||||||
|
|
||||||
def pad_chunk_columns(chunk, columns):
|
def pad_chunk_columns(chunk, columns):
|
||||||
"""Given a set of items to be inserted, make sure they all have the
|
"""Given a set of items to be inserted, make sure they all have the
|
||||||
same columns by padding columns with None if they are missing."""
|
same columns by padding columns with None if they are missing."""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user