airflow-client-python icon indicating copy to clipboard operation
airflow-client-python copied to clipboard

Pools API broken using airflow 2.1.2

Open byingyang opened this issue 4 years ago • 1 comments

Calling pool_client.get_pools() I get this error:

Invalid inputs given to generate an instance of 'PoolCollectionAllOf'. The input data was invalid for the allOf schema 'PoolCollectionAllOf' in the composed schema 'PoolCollection'. Error=Pool has no attribute 'running_slots' at ['received_data']['pools'][0]['running_slots']

Here is the response debug

DEBUG:airflow_client.client.rest: response body: b'{\n  "pools": [\n    {\n      "name": "default_pool",\n      "occupied_slots": 1,\n      "open_slots": 47,\n      "queued_slots": 0,\n      "running_slots": 1,\n      "slots": 48\n    },\n   ],\n  "total_entries": 1\n}\n'

byingyang avatar Aug 13 '21 02:08 byingyang

cc @ephraimbuddy @msumit

kaxil avatar Aug 13 '21 09:08 kaxil

hey @byingyang is the issue still happens on latest version?

eladkal avatar Feb 10 '23 15:02 eladkal

@eladkal We chose to call the API manually using the Requests lib for now, but we can check again soon.

byingyang avatar Feb 15 '23 18:02 byingyang

Cool. please let us know

eladkal avatar Feb 15 '23 18:02 eladkal

Working as expected on latest client version (2.5.1):

    # Get pool list
    pool_api_instance = pool_api.PoolApi(api_client)
    try:
        api_response = pool_api_instance.get_pools()
        pprint(api_response)
    except airflow_client.client.OpenApiException as e:
        print("Exception when calling PoolApi->get_pools: %s\n" % e)

Response:

image

Closing for now, feel free to reopen if needed.

pierrejeambrun avatar Feb 24 '23 22:02 pierrejeambrun