def get_ancestor_ids(cur, node):
    # TODO: add sort parameter
    sql = """
        SELECT
          ancestor
        FROM
          ancestors
        WHERE
          node=%s;
    """
    cur.execute(sql, (int(node), ))
    for result in cur:
        yield int(result['ancestor'])
Applies a Policy's case transforms to a string.
dataset/ETHPy150Open conceptsandtraining/libtree/libtree/core/query.py/get_ancestor_ids--crossover with--dataset/ETHPy150Open google/apis-client-generator/src/googleapis/codegen/language_model.py/LanguageModel.ApplyCaseTransform