pierrejeambrun commented on PR #44335: URL: https://github.com/apache/airflow/pull/44335#issuecomment-2498404049
> You are correct. I just checked. How about declaring sortable columns as constants and probably update SortParams to get these based on the Model? I don't know, as long as these hardcoded array of string (sortable columns) are specified once, I don't feel the need to over factorize or simplify. We cannot put the `sortable_columns` on the Model. Otherwise it introduce a dependency from the db layer to the webserver views/routes. That cannot be possible, the dependency should be the other way around, so the mapping between Models and sortable column has to leave somewhere else, probably in the webserver (FastAPI API). Then we end up with a mapping of constant arrays and SQLAlchemy ... and I find this quite messy. But maybe you have an idea on how to achieve a cleaner approach, I'd be glad to review a PR for that. Maybe another soution is instead of having 'strings' those could already be references to the actual column `DagRun.start_date`, etc... etc... benefiting from code completion, references, and removing hardcoded strings. -- 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]
