Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLAMiss is nullable and not always given back when pulling task instances #27423

Merged
merged 2 commits into from Nov 2, 2022

Conversation

csm10495
Copy link
Contributor

@csm10495 csm10495 commented Oct 31, 2022

related: apache/airflow-client-python#50

It appears as though the API doesn't have to return an SLAMiss value, so therefore it can be nullable. Without this change (and rebuilding of the client) we get a failure like so:

>>> ti = TaskInstanceApi(api_client)
>>> ti.get_task_instances('tutorial', 'manual__2022-10-31T20:32:58.139267+00:00')
...
ApiValueError: Invalid inputs given to generate an instance of 'TaskInstanceCollectionAllOf'. The input data was invalid for the allOf schema 'TaskInstanceCollectionAllOf' in the composed schema 'TaskInstanceCollection'. Error=Invalid type for variable 'sla_miss'. Required value type is SLAMiss and passed type was NoneType at ['received_data']['task_instances'][0]['sla_miss']

With this change (and rebuilding of the client) it works fine.

In [6]: ti.get_task_instances('tutorial', 'manual__2022-10-31T20:32:58.139267+00:00')
Out[6]:
{'task_instances': [{'dag_id': 'tutorial',
                     'dag_run_id': 'manual__2022-10-31T20:32:58.139267+00:00',
                     'duration': 0.116132,
                     'end_date': '2022-10-31T20:32:59.352991+00:00',
                     'execution_date': '2022-10-31T20:32:58.139267+00:00',
                     'executor_config': '{}',
...

@bbovenzi bbovenzi merged commit 63638cd into apache:main Nov 2, 2022
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Nov 9, 2022
@ephraimbuddy ephraimbuddy added this to the Airflow 2.4.3 milestone Nov 9, 2022
ephraimbuddy pushed a commit that referenced this pull request Nov 9, 2022
…nces (#27423)

* SLAMiss is nullable and not always given back when pulling task instances

See apache/airflow-client-python#50 for an example of the related error

* SLAMiss is nullable and not always given back when pulling task instances

See apache/airflow-client-python#50 for an example of the related error

(cherry picked from commit 63638cd)
ephraimbuddy pushed a commit that referenced this pull request Nov 9, 2022
…nces (#27423)

* SLAMiss is nullable and not always given back when pulling task instances

See apache/airflow-client-python#50 for an example of the related error

* SLAMiss is nullable and not always given back when pulling task instances

See apache/airflow-client-python#50 for an example of the related error

(cherry picked from commit 63638cd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:API Airflow's REST/HTTP API type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants