File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
sqlmesh/schedulers/airflow Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import logging
4+ import os
45import time
56import typing as t
67
@@ -19,8 +20,14 @@ class SqlmeshAirflowPlugin(AirflowPlugin):
1920
2021 @classmethod
2122 def on_load (cls , * args : t .Any , ** kwargs : t .Any ) -> None :
23+ if os .environ .get ("MWAA_AIRFLOW_COMPONENT" , "" ).lower () == "webserver" :
24+ # When using MWAA, the Webserver instance might not have access to the external state database.
25+ logger .info ("MWAA Webserver instance detected. Skipping SQLMesh state migration..." )
26+ return
27+
2228 with util .scoped_state_sync () as state_sync :
2329 try :
30+ logger .info ("Migrating SQLMesh state ..." )
2431 state_sync .migrate ()
2532 except Exception as ex :
2633 # This method is called once for each Gunicorn worker spawned by the Airflow Webserver,
You can’t perform that action at this time.
0 commit comments