SameerMesiah97 commented on code in PR #69109:
URL: https://github.com/apache/airflow/pull/69109#discussion_r3532250291
##########
providers/openlineage/tests/unit/openlineage/utils/test_utils.py:
##########
@@ -331,6 +333,57 @@ def test_dag_run_version(key):
assert result == key
[email protected]_test
[email protected](not AIRFLOW_V_3_3_PLUS, reason="multi-team requires
Airflow 3.3+")
+@patch("airflow.providers.openlineage.utils.utils.DagBundleModel.get_team_name")
+@patch("airflow.providers.openlineage.utils.utils.airflow_conf.getboolean",
return_value=True)
+def test_dag_run_team_name(
+ mock_getboolean,
+ mock_get_team_name,
+):
+ DagRunInfo._team_name_cache.clear()
+
+ dagrun_mock = MagicMock(DagRun)
+ dagrun_mock.dag_versions = [
+ MagicMock(
+ bundle_name="bundle_name",
+ bundle_version="bundle_version",
+ id="version_id",
+ version_number="version_number",
+ )
+ ]
+
+ mock_get_team_name.return_value = "team_a"
+
+ assert DagRunInfo.team_name(dagrun_mock) == "team_a"
+ assert DagRunInfo.team_name(dagrun_mock) == "team_a"
+
+ mock_get_team_name.assert_called_once_with("bundle_name")
+
+
[email protected]_test
[email protected](not AIRFLOW_V_3_3_PLUS, reason="multi-team requires
Airflow 3.1+")
Review Comment:
This was a typo that has now been fixed.
--
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]