DAG를 트리거합니다. 예를 들어 수동으로 트리거하거나 예약된 시간에 실행될 때까지 기다릴 수 있습니다.
DAG 예시:
importdatetimeimportosimportairflowfromairflow.providers.postgres.operators.postgresimportPostgresOperatorSQL_DATABASE=os.environ["SQL_DATABASE"]withairflow.DAG("airflow_db_connection_example",start_date=datetime.datetime(2024,1,1),schedule_interval=None,catchup=False)asdag:PostgresOperator(task_id="run_airflow_db_query",dag=dag,postgres_conn_id="airflow_db",database=SQL_DATABASE,sql="SELECT * FROM dag LIMIT 10;",)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-04-10(UTC)"],[[["This page details how to connect to and run SQL queries on the Airflow database of your Cloud Composer 1 environment."],["Directly accessing the Airflow database is discouraged; the Airflow REST API or Airflow CLI commands are the recommended alternatives."],["Connecting to the Airflow database involves creating and uploading a DAG that utilizes the `PostgresOperator` to specify and run the SQL query."],["Avoid adding custom tables or modifying the schema of the existing Airflow database to prevent complications."],["Backing up the environment's data should be done with snapshots instead of dumping the database."]]],[]]