bugraoz93 commented on code in PR #42782:
URL: https://github.com/apache/airflow/pull/42782#discussion_r1794300074
##########
airflow/api_fastapi/parameters.py:
##########
@@ -171,7 +180,10 @@ def to_orm(self, select: Select) -> Select:
f"the attribute does not exist on the model",
)
- column = self.attr_mapping.get(lstriped_orderby, None) or
getattr(DagModel, lstriped_orderby)
+ if self.to_replace:
+ lstriped_orderby = self.to_replace.get(lstriped_orderby,
lstriped_orderby)
Review Comment:
I realized the legacy endpoint returns column value as `connection_id` in
the return. Since it should be backwards compatible, I have adjusted it
accordingly. I think `to_replace` was a bit related to that part. We should
change the `to_replace` cases as in the models below.
`Field(alias="conn_id")` -> `Field(serialization_alias="connection_id",
validation_alias="conn_id")`
##########
airflow/api_fastapi/parameters.py:
##########
@@ -171,7 +180,10 @@ def to_orm(self, select: Select) -> Select:
f"the attribute does not exist on the model",
)
- column = self.attr_mapping.get(lstriped_orderby, None) or
getattr(DagModel, lstriped_orderby)
+ if self.to_replace:
+ lstriped_orderby = self.to_replace.get(lstriped_orderby,
lstriped_orderby)
Review Comment:
I realized the legacy endpoint returns column value as `connection_id` in
the return. Since it should be backwards compatible, I have adjusted it
accordingly. I think `to_replace` was a bit related to that part. I think we
should change the `to_replace` cases as in the models below.
`Field(alias="conn_id")` -> `Field(serialization_alias="connection_id",
validation_alias="conn_id")`
--
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]