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

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

        def get_new_activities(db, param):
    if param.allow_private_bugs:
        param.screened_fields = SQL(SCREENED_FIELDDEFS)
    else:
        param.screened_fields = SQL([-1])

    #TODO: CF_LAST_RESOLVED IS IN PDT, FIX IT
    param.bug_filter = db.esfilter2sqlwhere({"terms": {"a.bug_id": param.bug_list}})
    param.mixed_case_fields = SQL(MIXED_CASE)

    if param.start_time > 0:
        Log.debug()

    output = db.query("""
        SELECT
            a.bug_id,
            UNIX_TIMESTAMP(CONVERT_TZ(bug_when, 'US/Pacific','UTC'))*1000 AS modified_ts,
            lower(login_name) AS modified_by,
            replace(field.`name`, '.', '_') AS field_name,
            CAST(
                CASE
                WHEN a.fieldid IN {{screened_fields}} THEN ''
                WHEN a.fieldid IN {{mixed_case_fields}} THEN trim(added)
                WHEN trim(added)='' THEN NULL
                ELSE lower(trim(added))
                END
            AS CHAR CHARACTER SET utf8) AS new_value,
            CAST(
                CASE
                WHEN a.fieldid IN {{screened_fields}} THEN ''
                WHEN a.fieldid IN {{mixed_case_fields}} THEN trim(removed)
                WHEN trim(removed)='' THEN NULL
                ELSE lower(trim(removed))
                END
            AS CHAR CHARACTER SET utf8) AS old_value,
            attach_id,
            9 AS _merge_order
        FROM
            bugs_activity a
        JOIN
            profiles p ON a.who = p.userid
        JOIN
            fielddefs field ON a.fieldid = field.`id`
        WHERE
            {{bug_filter}} AND
            bug_when >= {{start_time_str}}
        ORDER BY
            bug_id,
            bug_when DESC,
            attach_id
    """, param)

    return output
        


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