This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new b9f868b Remove errors raised during initialiation of virtualenv
(#10896)
b9f868b is described below
commit b9f868b5ec30d028e52f49b5deafb5214320f521
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sat Sep 12 14:39:34 2020 +0200
Remove errors raised during initialiation of virtualenv (#10896)
Our migration scripts are written in the way that if you
are running them to reset the db and you have some files in
example_dags or dags, or some plugins in your plugins folder,
you will get various kinds of errors.
Those errors are printed to the user and even if they are
ultimately ignored by the SqlAlchemy migration process,
they are confusing whether the database reset
(and thus the whole initialize-virtualenv) were successful
or not.
This change disables any DAGs that could be loaded during the
DB reset (in case of running './breeze initialize-virtualenv'.
Fixes #10894
---
breeze | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/breeze b/breeze
index 122d44a..ac01a87 100755
--- a/breeze
+++ b/breeze
@@ -240,11 +240,24 @@ function breeze::initialize_virtualenv() {
echo
echo "Resetting AIRFLOW sqlite database"
echo
- AIRFLOW__CORE__UNIT_TEST_MODE="False" airflow db reset -y
+ AIRFLOW__CORE__LOAD_EXAMPLES="False" \
+ AIRFLOW__CORE__UNIT_TEST_MODE="False" \
+ AIRFLOW__CORE__SQL_ALCHEMY_POOL_ENABLED="False" \
+ AIRFLOW__CORE__DAGS_FOLDER="${AIRFLOW_SOURCES}/empty" \
+ AIRFLOW__CORE__PLUGINS_FOLDER="${AIRFLOW_SOURCES}/empty" \
+ airflow db reset -y
echo
echo "Resetting AIRFLOW sqlite unit test database"
echo
- AIRFLOW__CORE__UNIT_TEST_MODE="True" airflow db reset -y
+ AIRFLOW__CORE__LOAD_EXAMPLES="False" \
+ AIRFLOW__CORE__UNIT_TEST_MODE="True" \
+ AIRFLOW__CORE__SQL_ALCHEMY_POOL_ENABLED="False" \
+ AIRFLOW__CORE__DAGS_FOLDER="${AIRFLOW_SOURCES}/empty" \
+ AIRFLOW__CORE__PLUGINS_FOLDER="${AIRFLOW_SOURCES}/empty" \
+ airflow db reset -y
+ echo
+ echo "Initialization of virtualenv was successful! Go ahead and
develop Airflow!"
+ echo
exit 0
fi
}