vincbeck commented on code in PR #66954:
URL: https://github.com/apache/airflow/pull/66954#discussion_r3249410915
##########
airflow-core/src/airflow/example_dags/example_asset_allow_teams.py:
##########
@@ -15,32 +15,34 @@
# specific language governing permissions and limitations
# under the License.
"""
-Example DAG demonstrating cross-team asset triggering with
``allow_producer_teams``.
+Example DAG demonstrating cross-team asset triggering with
``AssetAccessControl``.
When Multi-Team mode is enabled (``[core] multi_team = True``), asset events
are filtered by team
membership. By default, a consuming DAG only receives events from DAGs within
the same team.
Usage:
- ``team_analytics_producer`` (belonging to ``team_analytics``) produces
events on ``shared_data``.
- ``team_ml_consumer`` (belonging to ``team_ml``) consumes ``shared_data``.
- - Because ``shared_data`` has ``allow_producer_teams=["team_analytics"]``,
events from ``team_analytics``
- are accepted by ``team_ml_consumer``.
- - Without ``allow_producer_teams``, the cross-team event would be blocked.
+ - Because ``shared_data`` has
``access_control=AssetAccessControl(producer_teams=["team_analytics"])``,
+ events from ``team_analytics`` are accepted by ``team_ml_consumer``.
+ - Without ``access_control``, the cross-team event would be blocked.
"""
from __future__ import annotations
import pendulum
from airflow.providers.standard.operators.bash import BashOperator
-from airflow.sdk import DAG, Asset
+from airflow.sdk import DAG, Asset, AssetAccessControl
-# [START asset_allow_producer_teams]
-# Define an asset that accepts events from team_analytics in addition to the
consumer's own team.
+# [START asset_access_control]
Review Comment:
Yeah I split the documentation and implementation in 2 different PRs, hence
the ambiguity. I did that to avoid having massive PRs. I'll rebase and update
the doc in https://github.com/apache/airflow/pull/66949 once this one merged.
Unless you want me to consolidate everything in one PR?
--
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]