guan404ming commented on code in PR #55160:
URL: https://github.com/apache/airflow/pull/55160#discussion_r2342929011
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/event_logs.py:
##########
@@ -41,6 +41,9 @@ class EventLogResponse(BaseModel):
dag_display_name: str | None = Field(
validation_alias=AliasPath("dag_model", "dag_display_name"),
default=None
)
+ task_display_name: str | None = Field(
Review Comment:
Thanks for catching this. I've updated to correct version.
After reviewing in more detail, I think Pierre is right. We still need to
explicitly specify `lazy="selectin"`, since the default is `lazy="select"` (see
[SQLAlchemy
source](https://github.com/sqlalchemy/sqlalchemy/blob/adabce3aa6ce25e785762b5a28a294e9112b03b5/lib/sqlalchemy/orm/_orm_constructors.py#L1465)).
I had misunderstood and thought it would default to "selectin" when
primaryjoin is defined.
So ideally the updated usage for alias related cases would be:
- If SQLAlchemy can auto-detect the relationship -> only specify
`lazy="selectin"`
- If SQLAlchemy cannot auto-detect -> specify foreign_keys and primaryjoin
explicitly + specify `lazy="selectin"`
--
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]