You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "dstandish (via GitHub)" <gi...@apache.org> on 2024/03/27 21:54:21 UTC

[PR] Remove select_column option in TaskInstance.get_task_instance [airflow]

dstandish opened a new pull request, #38571:
URL: https://github.com/apache/airflow/pull/38571

   This was originally added in #28900 presumably for compatiblity with serialization.  Maybe things have changed since then, because it's actually the Row object that does not serialize properly (and this is what's returned with this option True) meanwhile the TaskInstance object actually is serialized properly.  This is the only usage of this param, and it's not needed here, so I'm just removing it.  You could argue that it's public and can't be removed but I think it's pretty safe.
   


-- 
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: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Remove select_column option in TaskInstance.get_task_instance [airflow]

Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish merged PR #38571:
URL: https://github.com/apache/airflow/pull/38571


-- 
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: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Remove select_column option in TaskInstance.get_task_instance [airflow]

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #38571:
URL: https://github.com/apache/airflow/pull/38571#discussion_r1547093071


##########
airflow/models/taskinstance.py:
##########
@@ -532,8 +531,7 @@ def _refresh_from_db(
         task_instance.end_date = ti.end_date
         task_instance.duration = ti.duration
         task_instance.state = ti.state
-        # Since we selected columns, not the object, this is the raw value
-        task_instance.try_number = ti.try_number
+        task_instance.try_number = ti._try_number

Review Comment:
   Should probably add a comment here on needing to use the raw value.



-- 
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: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Remove select_column option in TaskInstance.get_task_instance [airflow]

Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham commented on PR #38571:
URL: https://github.com/apache/airflow/pull/38571#issuecomment-2027702306

   > I think there were still some tests failing @jedcunningham
   
   The 1 I looked at didn't seem obviously related, in the 10 seconds I looked at it. So I figured a fresh run wouldn't hurt. But maybe it is related :)


-- 
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: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Remove select_column option in TaskInstance.get_task_instance [airflow]

Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish commented on PR #38571:
URL: https://github.com/apache/airflow/pull/38571#issuecomment-2027699902

   I think there were still some tests failing @jedcunningham 


-- 
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: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Remove select_column option in TaskInstance.get_task_instance [airflow]

Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish commented on PR #38571:
URL: https://github.com/apache/airflow/pull/38571#issuecomment-2028378771

   figured out what was going on here.  it was a very confusing one.  not obvious.  basically, when switching it back to just query the TI, this had the effect of incrementing try_number every time ti.refresh_from_db is called (since try_number is bananas). This nonobviously caused failure in test of reschedule poke mode sensor because it could not find the right reschedule db obj so the start date was advancing when it shouldn't have.  The reason was just try number shenanigans.  But so then i found that that the real reason that we were query attrs directly (instead of orm obj) was to avoid locking dag_run!  But we should be able to do that by simply lazy loading the attr.....  So I added two changes (1) lazy load dag run attr in this func and (2) go back to setting try_number from private attr _try_number (which is what it was before the deadlock fix orig added).  well that was a mounthful...


-- 
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: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Remove select_column option in TaskInstance.get_task_instance [airflow]

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on PR #38571:
URL: https://github.com/apache/airflow/pull/38571#issuecomment-2031011676

   I hope we’ll be able to clean up the try_number bs when we implement AIP-64.


-- 
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: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Remove select_column option in TaskInstance.get_task_instance [airflow]

Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish commented on PR #38571:
URL: https://github.com/apache/airflow/pull/38571#issuecomment-2027918211

   Yeah there was some weird error related to a test of sensor. I don’t think it’s really an issue probably something with the test but I was still working through it 


-- 
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: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Remove select_column option in TaskInstance.get_task_instance [airflow]

Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish commented on PR #38571:
URL: https://github.com/apache/airflow/pull/38571#issuecomment-2028255533

   oh -- I thought you merged it @jedcunningham  -- sorry i was confused 🙃


-- 
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: commits-unsubscribe@airflow.apache.org

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


Re: [PR] Remove select_column option in TaskInstance.get_task_instance [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #38571:
URL: https://github.com/apache/airflow/pull/38571#issuecomment-2027829935

   Those test failure looked like abrupt failure of the docker engine in the middle of testing. I re-run just the tests and if it appears again then we have something interesting here.


-- 
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: commits-unsubscribe@airflow.apache.org

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