mattinbits commented on issue #21171:
URL: https://github.com/apache/airflow/issues/21171#issuecomment-1025238837
More details on reproducibility. Start a SQL Server instance with timezone
set to one hour ahead of UTC:
```
docker container run \
--rm \
--name mssql \
--env 'ACCEPT_EULA=Y' \
--env 'MSSQL_SA_PASSWORD=Mssqlpwd123' \
--env 'TZ=Europe/Copenhagen' \
--publish 1433:1433 \
--detach mcr.microsoft.com/mssql/server:2019-CU5-ubuntu-18.04
```
Create the Airflow DB:
```
docker exec mssql /opt/mssql-tools/bin/sqlcmd -U sa -P Mssqlpwd123 -Q
"CREATE DATABASE AIRFLOW;"
docker exec mssql /opt/mssql-tools/bin/sqlcmd -U sa -P Mssqlpwd123 -Q "ALTER
DATABASE Airflow SET READ_COMMITTED_SNAPSHOT ON;"
```
Conn string:
```
sql_alchemy_conn =
mssql+pyodbc://sa:Mssqlpwd123@localhost/airflow?driver=ODBC+Driver+17+for+SQL+Server
```
And a DAG. Change the cron to be less than one hour ahead of the current
time in UTC:
```
from airflow.models.dag import DAG
from airflow.operators.dummy import DummyOperator
from datetime import datetime
dag = DAG(
dag_id="example",
start_date=datetime(2021, 1, 1),
schedule_interval="00 22 * * *",
catchup=False
)
with dag:
task = DummyOperator(task_id="dummy")
```
Start Airflow, start the DAG, observe the premature DAG execution.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]