Tegh25 commented on code in PR #70416:
URL: https://github.com/apache/airflow/pull/70416#discussion_r3754877884
##########
airflow-core/src/airflow/jobs/job.py:
##########
@@ -101,6 +101,10 @@ class Job(Base, LoggingMixin):
executor_class: Mapped[str | None] = mapped_column(String(500))
hostname: Mapped[str | None] = mapped_column(String(500))
unixname: Mapped[str | None] = mapped_column(String(1000))
+ team_name: Mapped[str | None] = mapped_column(
+ String(50), ForeignKey("team.name", ondelete="SET NULL"), nullable=True
+ )
+ bundle_names: Mapped[list[str] | None] = mapped_column(ExtendedJSON,
nullable=True)
Review Comment:
`bundle_names` isn’t used to fetch `team_name` in this PR, it’s describes
the Dag processor’s scope and is returned directly. Health returns those names
so users can see which bundles an instance owns.
We can resolve bundle to team via `DagBundleModel.get_team_names` (the
manager already does that for metrics), but a processor can own multiple
bundles, bundles can be teamless/shared, and multi-team may be off, so a single
`team_name` on the job can’t replace the list of `bundle_names`. Triggerers,
for example, are team-scoped by design, but Dag processors are bundle-scoped.
Our original proposal may have been unclear with exactly what we planned to
do with Dag processor `bundle_names`, I apologize for that. I believe returning
`bundle_names` is the best approach here, but we can discuss `team_name`
retrieval logic if you want to select just a single `team_name`.
--
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]