Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

        def get_comments(db, param):
    if param.allow_private_bugs:
        return []
    if not param.bug_list:
        return []

    param.comments_filter = SQL("isprivate=0")
    param.bug_filter = db.esfilter2sqlwhere({"terms": {"bug_id": param.bug_list}})

    try:
        comments = db.query("""
            SELECT
                c.comment_id,
                c.bug_id,
                p.login_name modified_by,
                UNIX_TIMESTAMP(CONVERT_TZ(bug_when, 'US/Pacific','UTC'))*1000 AS modified_ts,
                c.thetext comment,
                c.isprivate
            FROM
                longdescs c
            LEFT JOIN
                profiles p ON c.who = p.userid
            WHERE
                {{bug_filter}} AND
                bug_when >= {{start_time_str}} AND
                {{comments_filter}}
            """, param)

        return comments
    except Exception, e:
        Log.error("can not get comment data", e)
        


src/b/u/Bugzilla-ETL-0.3.13353/bzETL/bz_etl.py   Bugzilla-ETL(Download)
 
from bzETL import parse_bug_history, transform_bugzilla, extract_bugzilla, alias_analysis
from extract_bugzilla import get_private_bugs, get_recent_private_attachments, get_recent_private_comments, get_comments, get_comments_by_id, get_recent_private_bugs, get_current_time, get_bugs, get_dependencies, get_flags, get_new_activities, get_bug_see_also, get_attachments, get_tracking_flags, get_keywords, get_cc, get_bug_groups, get_duplicates
from parse_bug_history import BugHistoryParser
 
    with comment_db_cache_lock:
        Log.note("Read comments from database")
        comments=get_comments(comment_db_cache[0], param)
 
    with Timer("Write {{num}} comments to ElasticSearch", {"num":len(comments)}):