You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "kandharvishnu (via GitHub)" <gi...@apache.org> on 2024/11/08 16:22:26 UTC
[PR] get_task_instance_try_details API returns TaskInstanceHistory schema [airflow]
kandharvishnu opened a new pull request, #43830:
URL: https://github.com/apache/airflow/pull/43830
these
- get_task_instance_try_details
- get_mapped_task_instance_try_details
- get_task_instance_tries
- get_mapped_task_instance_tries
are actually returning TaskInstanceHistory
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
<!-- Please keep an empty line above the dashes. -->
---
Airflow API Docs mentions that the [get_task_instance_try_details](https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/get_task_instance_try_details) return `task_instance` schema

But API actually returns `TaskInstanceHistory` schema
<img width="1300" alt="image" src="https://github.com/user-attachments/assets/8c4b2fc2-eaf8-4ab5-addf-c26066050037">
--
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] get_task_instance_try_details API returns TaskInstanceHistory schema [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on PR #43830:
URL: https://github.com/apache/airflow/pull/43830#issuecomment-2470807546
There's no difference between TI and TI History except for loading related objects. It makes me wonder if we need this PR
--
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] get_task_instance_try_details API returns TaskInstanceHistory schema [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on PR #43830:
URL: https://github.com/apache/airflow/pull/43830#issuecomment-2478510905
>Also there is the deprecated execution_date difference, maybe the TaskInstanceHistory is missing the logical_date/execution_date ?
the logical_date/execution_date is a proxy in TaskInstance so we couldn't have it in TI history.
--
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] get_task_instance_try_details API returns TaskInstanceHistory schema [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #43830:
URL: https://github.com/apache/airflow/pull/43830#discussion_r1838274470
##########
airflow/api_connexion/openapi/v1.yaml:
##########
@@ -3784,7 +3784,98 @@ components:
items:
$ref: "#/components/schemas/TaskInstance"
- $ref: "#/components/schemas/CollectionInfo"
+ TaskInstanceHistory:
+ type: object
+ properties:
+ task_id:
+ type: string
+ task_display_name:
+ type: string
+ description: |
+ Human centric display text for the task.
+
+ *New in version 2.9.0*
+ dag_id:
+ type: string
+ dag_run_id:
+ type: string
+ description: |
+ The DagRun ID for this task instance
+
+ *New in version 2.3.0*
+ execution_date:
+ type: string
+ format: datetime
Review Comment:
I don't think there is an `execution_date` on the `TaskInstanceHistorySchema`.
--
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] get_task_instance_try_details API returns TaskInstanceHistory schema [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #43830:
URL: https://github.com/apache/airflow/pull/43830#issuecomment-2479346734
> Those are the differences. We can't be able to have those in TI history.
As there are some differences I think we need to actually fix the spec with the actual response returned. Otherwise client might expect one of those fields `trigger, etc..` while those are missing.
--
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] get_task_instance_try_details API returns TaskInstanceHistory schema [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy merged PR #43830:
URL: https://github.com/apache/airflow/pull/43830
--
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] get_task_instance_try_details API returns TaskInstanceHistory schema [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #43830:
URL: https://github.com/apache/airflow/pull/43830#issuecomment-2470901004
> There's no difference between TI and TI History except for loading related objects. It makes me wonder if we need this PR
In that case exposing a TaskInstance might be sufficient and less confusing for users of the API. Otherwise they might be intrigued by `TaskInstanceHistory`. Maybe just a comment in the code could do the trick for us ?
--
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] get_task_instance_try_details API returns TaskInstanceHistory schema [airflow]
Posted by "kandharvishnu (via GitHub)" <gi...@apache.org>.
kandharvishnu commented on PR #43830:
URL: https://github.com/apache/airflow/pull/43830#issuecomment-2470870947
> There's no difference between TI and TI History except for loading related objects. It makes me wonder if we need this PR
I'm uncertain if this PR directly impacts the [API page](https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/get_task_instances_batch). However, after running a comparison between the output I received from a cURL command and the results shown on the API documentation page, I noticed some differences. Due to these discrepancies, I decided to submit a PR for further review and possible updates.
--
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] get_task_instance_try_details API returns TaskInstanceHistory schema [airflow]
Posted by "kandharvishnu (via GitHub)" <gi...@apache.org>.
kandharvishnu commented on PR #43830:
URL: https://github.com/apache/airflow/pull/43830#issuecomment-2470919913
> Also there is the deprecated `execution_date` difference, maybe the TaskInstanceHistory is missing the `logical_date`/`execution_date` ?
Additionally, I noticed that the following columns are missing in `TaskInstanceHistory` when compared with `TaskInstance`:
- `sla_miss`
- `rendered_map_index`
- `rendered_fields`
- `trigger`
- `triggerer_job`
- `note`
--
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] get_task_instance_try_details API returns TaskInstanceHistory schema [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on PR #43830:
URL: https://github.com/apache/airflow/pull/43830#issuecomment-2478513763
> > Also there is the deprecated `execution_date` difference, maybe the TaskInstanceHistory is missing the `logical_date`/`execution_date` ?
>
> Additionally, I noticed that the following columns are missing in `TaskInstanceHistory` when compared with `TaskInstance`:
>
> * `sla_miss`
> * `rendered_map_index`
> * `rendered_fields`
> * `trigger`
> * `triggerer_job`
> * `note`
Those are the differences. We can't be able to have those in TI history.
--
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