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 explains how to connect to and run SQL queries on the Cloud SQL instance that hosts the Airflow database for your Cloud Composer environment."],["While direct access to the Airflow database is possible, it's advised to use alternative methods like the Airflow REST API or CLI commands whenever feasible."],["To connect, create a DAG with `PostgresOperator` operators, specifying the SQL query in the `sql` parameter, and uploading/triggering it."],["It is not recommended to add custom tables or change the schema of the airflow database."],["Backing up the environment's data, including the Airflow database, should be done using snapshots instead of the deprecated database dumping method."]]],[]]