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/04/10 19:37:26 UTC
[PR] Fix error when setting try_number from TaskInstancePydantic [airflow]
dstandish opened a new pull request, #38907:
URL: https://github.com/apache/airflow/pull/38907
(no comment)
--
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] Fix error when setting try_number from TaskInstancePydantic [airflow]
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #38907:
URL: https://github.com/apache/airflow/pull/38907#discussion_r1560429399
##########
airflow/models/taskinstance.py:
##########
@@ -539,7 +539,11 @@ def _refresh_from_db(
task_instance.end_date = ti.end_date
task_instance.duration = ti.duration
task_instance.state = ti.state
- task_instance.try_number = ti._try_number # private attr to get value unaltered by accessor
+ try:
+ task_instance.try_number = ti._try_number # private attr to get value unaltered by accessor
+ except AttributeError:
+ task_instance.try_number = ti.try_number # the TaskInstancePydantic case
Review Comment:
Maybe we should make `_try_number` an alias (property) on TaskInstancePydantic instead? This seems too problematic.
--
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] Fix error when setting try_number from TaskInstancePydantic [airflow]
Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish commented on code in PR #38907:
URL: https://github.com/apache/airflow/pull/38907#discussion_r1560430449
##########
airflow/models/taskinstance.py:
##########
@@ -539,7 +539,11 @@ def _refresh_from_db(
task_instance.end_date = ti.end_date
task_instance.duration = ti.duration
task_instance.state = ti.state
- task_instance.try_number = ti._try_number # private attr to get value unaltered by accessor
+ try:
+ task_instance.try_number = ti._try_number # private attr to get value unaltered by accessor
+ except AttributeError:
+ task_instance.try_number = ti.try_number # the TaskInstancePydantic case
Review Comment:
Yeah i'm actually working on that right now. But I'm on a detour trying to get try number working properly from a logging perspective with db isolation enabled. Try number immutability cannot come soon enough.
--
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] Fix error when setting try_number from TaskInstancePydantic [airflow]
Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish commented on code in PR #38907:
URL: https://github.com/apache/airflow/pull/38907#discussion_r1560444913
##########
airflow/models/taskinstance.py:
##########
@@ -539,7 +539,11 @@ def _refresh_from_db(
task_instance.end_date = ti.end_date
task_instance.duration = ti.duration
task_instance.state = ti.state
- task_instance.try_number = ti._try_number # private attr to get value unaltered by accessor
+ try:
+ task_instance.try_number = ti._try_number # private attr to get value unaltered by accessor
+ except AttributeError:
+ task_instance.try_number = ti.try_number # the TaskInstancePydantic case
Review Comment:
this might not be right, gonna mark draft again
--
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] Fix error when setting try_number from TaskInstancePydantic [airflow]
Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish commented on PR #38907:
URL: https://github.com/apache/airflow/pull/38907#issuecomment-2050307736
closing in favor of #38943
--
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] Fix error when setting try_number from TaskInstancePydantic [airflow]
Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish closed pull request #38907: Fix error when setting try_number from TaskInstancePydantic
URL: https://github.com/apache/airflow/pull/38907
--
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] Fix error when setting try_number from TaskInstancePydantic [airflow]
Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish commented on code in PR #38907:
URL: https://github.com/apache/airflow/pull/38907#discussion_r1560437167
##########
airflow/models/taskinstance.py:
##########
@@ -539,7 +539,11 @@ def _refresh_from_db(
task_instance.end_date = ti.end_date
task_instance.duration = ti.duration
task_instance.state = ti.state
- task_instance.try_number = ti._try_number # private attr to get value unaltered by accessor
+ try:
+ task_instance.try_number = ti._try_number # private attr to get value unaltered by accessor
+ except AttributeError:
+ task_instance.try_number = ti.try_number # the TaskInstancePydantic case
Review Comment:
ok @uranusjr I updated this PR to make pydantic try_number behavior more like orm model PTAL
--
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