pierrejeambrun commented on code in PR #42782:
URL: https://github.com/apache/airflow/pull/42782#discussion_r1793600020
##########
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 think we can get rid of the `to_replace`. It adds extra complexity for
mapping things together. We can just rename to use the appropriate one. No need
to remap. i.e `conn_id`. Or again find a way to always just use the mapping. So
we have only 1 ugly mapping and everything uses that to retrieve the `db/model`
equivalent.
--
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]