You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/10 10:43:30 UTC

[GitHub] [airflow] ashb edited a comment on pull request #9170: [WIP] Read only endpoint for XCom #8134

ashb edited a comment on pull request #9170:
URL: https://github.com/apache/airflow/pull/9170#issuecomment-641910253


   > It looks good, but I don't know if it suits our code style. We use explicit joins instead of relying on ORM generated more often.
   
   @mik-laj I agree we don't _currently_ use relationships; I guess I am proposing that we currently start using them. The queries generated is the same/similar. Using explicit relationships feels like a good idea to me, as it documents "yes, this is an 'official' relationship between these two tables, not just something that happens to have the same named columns".
   
   And the example query I had in my commit message was more complex than we needed. This works:
   
   ```python
   ti = s.query(TI).filter_by(
       dag_id='example_dag1', task_id='print_date2'
   ).join(TI.dag_run).filter_by(
       run_id='scheduled__2020-06-08T11:00:00+00:00'
   ).one_or_none()
   ```
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org