(doc_ids)
Get HASH for each doc_id from PostgreSQL

        This is used to ensure the python version is consistent with what's
        being used by PL/Proxy
Get HASH for each doc_id from PostgreSQL
Get HASH for each doc_id from PostgreSQL
def hash_doc_ids_sql_for_testing(doc_ids):
        """Get HASH for each doc_id from PostgreSQL

        This is used to ensure the python version is consistent with what's
        being used by PL/Proxy
        """
        assert settings.USE_PARTITIONED_DATABASE

        params = ','.join(["(%s)"] * len(doc_ids))
        query = """
            SELECT doc_id, hash_string(doc_id, 'siphash24') AS hash
            FROM (VALUES {}) AS t (doc_id)
        """.format(params)
        with XFormInstanceSQL.get_plproxy_cursor() as cursor:
            cursor.execute(query, doc_ids)
            rows = fetchall_as_namedtuple(cursor)
            return {row.doc_id: row.hash for row in rows}
def hash_doc_ids_sql_for_testing ( doc_ids ) : assert settings . USE_PARTITIONED_DATABASE params = ',' . join ( [ "(%s)" ] * len ( doc_ids ) ) query = """
            SELECT doc_id, hash_string(doc_id, 'siphash24') AS hash
            FROM (VALUES {}) AS t (doc_id)
        """ . format ( params ) with XFormInstanceSQL . get_plproxy_cursor ( ) as cursor : cursor . execute ( query , doc_ids ) rows = fetchall_as_namedtuple ( cursor ) return { row . doc_id : row . hash for row in rows }