Remove duplicate function

This commit is contained in:
Friedrich Lindenberg 2020-06-28 21:09:09 +02:00
parent 37c0f87d10
commit 07ef8d22c1

View File

@ -1,7 +1,6 @@
from hashlib import sha1
from urllib.parse import urlparse
from collections import OrderedDict
from collections.abc import Iterable
from sqlalchemy.exc import ResourceClosedError
QUERY_STEP = 1000
@ -110,15 +109,6 @@ def index_name(table, columns):
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):
"""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."""