コード例 #1
0
ファイル: endpoints.py プロジェクト: folly3/airflow-1
def get_lineage(dag_id: str, execution_date: str):
    """Get Lineage details for a DagRun"""
    # Convert string datetime into actual datetime
    try:
        execution_dt = timezone.parse(execution_date)
    except ValueError:
        error_message = (
            'Given execution date, {}, could not be identified '
            'as a date. Example date format: 2015-11-16T14:34:15+00:00'.format(
                execution_date))
        log.error(error_message)
        response = jsonify({'error': error_message})
        response.status_code = 400

        return response

    try:
        lineage = get_lineage_api(dag_id=dag_id, execution_date=execution_dt)
    except AirflowException as err:
        log.error(err)
        response = jsonify(error=f"{err}")
        response.status_code = err.status_code
        return response
    else:
        return jsonify(lineage)
コード例 #2
0
ファイル: local_client.py プロジェクト: yqian1991/airflow
 def get_lineage(self, dag_id, execution_date):
     lineage = get_lineage_api(dag_id=dag_id, execution_date=execution_date)
     return lineage