Skip to content

Commit

Permalink
fix tests after main rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jedcunningham committed Jan 7, 2025
1 parent 34a952d commit dcf0549
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion airflow/dag_processing/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def run(self):
DagBundlesManager().sync_bundles_to_db()

self.log.info("Getting all DAG bundles")
self._dag_bundles = DagBundlesManager().get_all_dag_bundles()
self._dag_bundles = list(DagBundlesManager().get_all_dag_bundles())

return self._run_parsing_loop()

Expand Down
15 changes: 8 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ def configure_testing_dag_bundle():

@contextmanager
def _config_bundle(path_to_parse: Path | str):
bundle_config = {
"classpath": "airflow.dag_processing.bundles.local.LocalDagBundle",
"kwargs": {"local_folder": str(path_to_parse), "refresh_interval": 30},
}
with conf_vars(
{("dag_bundles", "testing"): json.dumps(bundle_config), ("dag_bundles", "dags_folder"): ""}
):
bundle_config = [
{
"name": "testing",
"classpath": "airflow.dag_processing.bundles.local.LocalDagBundle",
"kwargs": {"local_folder": str(path_to_parse), "refresh_interval": 30},
}
]
with conf_vars({("dag_bundles", "backends"): json.dumps(bundle_config)}):
yield

return _config_bundle
Expand Down
4 changes: 2 additions & 2 deletions tests_common/test_utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _bootstrap_dagbag():
dagbag = DagBag()
# Save DAGs in the ORM
if AIRFLOW_V_3_0_PLUS:
dagbag.sync_to_db(bundle_name="dags_folder", bundle_version=None, session=session)
dagbag.sync_to_db(bundle_name="dags-folder", bundle_version=None, session=session)
else:
dagbag.sync_to_db(session=session)

Expand Down Expand Up @@ -120,7 +120,7 @@ def parse_and_sync_to_db(folder: Path | str, include_examples: bool = False):

dagbag = DagBag(dag_folder=folder, include_examples=include_examples)
if AIRFLOW_V_3_0_PLUS:
dagbag.sync_to_db("dags_folder", None, session)
dagbag.sync_to_db("dags-folder", None, session)
else:
dagbag.sync_to_db(session=session) # type: ignore[call-arg]
session.commit()
Expand Down

0 comments on commit dcf0549

Please sign in to comment.