From cd459a3834f10c550b9babf6817a7ad3db84629b Mon Sep 17 00:00:00 2001 From: r-richmond Date: Tue, 10 Jun 2025 04:59:26 -0700 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=93=9D=20Improve=20Getting=20Started?= =?UTF-8?q?=20Section=20(#135)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Improve Getting Started Section * Add missed change from apache/airflow * Sync with pre-commit from airflow --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 22c14fb4..f071d077 100644 --- a/README.md +++ b/README.md @@ -178,14 +178,6 @@ For details on enabling/configuring CORS, see To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. -If you want to check which auth backend is currently set, you can use -`airflow config get-value api auth_backends` command as in the example below. - -```bash -$ airflow config get-value api auth_backends -airflow.providers.fab.auth_manager.api.auth.backend.basic_auth -``` - The default is to deny all requests. For details on configuring the authentication, see @@ -279,24 +271,62 @@ import airflow_client.client ## Getting Started +Before attempting the following examples ensure you have an account with API access. +As an example you can create an account for usage with the API as follows using the Airflow CLI. + +```bash +airflow users create -u admin-api -e admin-api@example.com -f admin-api -l admin-api -p $PASSWORD -r Admin +``` + Please follow the [installation procedure](#installation--usage) and then run the following: ```python import airflow_client.client +import requests from airflow_client.client.rest import ApiException from pprint import pprint +from pydantic import BaseModel + + +# What we expect back from auth/token +class AirflowAccessTokenResponse(BaseModel): + access_token: str + + +# An optional helper function to retrieve an access token +def get_airflow_client_access_token( + host: str, + username: str, + password: str, +) -> str: + url = f"{host}/auth/token" + payload = { + "username": username, + "password": password, + } + headers = {"Content-Type": "application/json"} + response = requests.post(url, json=payload, headers=headers) + if response.status_code != 201: + raise RuntimeError(f"Failed to get access token: {response.status_code} {response.text}") + response_success = AirflowAccessTokenResponse(**response.json()) + return response_success.access_token + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. -configuration = airflow_client.client.Configuration(host="http://localhost") +host = "http://localhost" +configuration = airflow_client.client.Configuration(host=host) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. -configuration.access_token = os.environ["ACCESS_TOKEN"] - +configuration.access_token = get_airflow_client_access_token( + host=host, + username="admin-api", + password=os.environ["PASSWORD"], +) # Enter a context with an instance of the API client with airflow_client.client.ApiClient(configuration) as api_client: @@ -599,7 +629,7 @@ You can also set it by env variable: `export AIRFLOW__CORE__LOAD_EXAMPLES=True` * optionally expose configuration (NOTE! that this is dangerous setting). The script will happily run with the default setting, but if you want to see the configuration, you need to expose it. - In the `[webserver]` section of your `airflow.cfg` set: + In the `[api]` section of your `airflow.cfg` set: ```ini [api] From d71f13a738cb4752517f66a568f416e4541b377c Mon Sep 17 00:00:00 2001 From: Kaxil Naik Date: Wed, 11 Jun 2025 01:54:22 +0530 Subject: [PATCH 2/2] Update Python Client to 3.0.2 (#136) --- CHANGELOG.md | 18 ++++++ airflow_client/client/__init__.py | 3 +- airflow_client/client/api/dag_api.py | 17 ------ .../client/api/task_instance_api.py | 2 +- airflow_client/client/api_client.py | 2 +- airflow_client/client/configuration.py | 2 +- airflow_client/client/models/__init__.py | 1 - airflow_client/client/models/bulk_action.py | 38 ------------ .../bulk_create_action_connection_body.py | 12 +++- .../models/bulk_create_action_pool_body.py | 12 +++- .../bulk_create_action_variable_body.py | 12 +++- .../bulk_delete_action_connection_body.py | 12 +++- .../models/bulk_delete_action_pool_body.py | 12 +++- .../bulk_delete_action_variable_body.py | 12 +++- .../bulk_update_action_connection_body.py | 12 +++- .../models/bulk_update_action_pool_body.py | 12 +++- .../bulk_update_action_variable_body.py | 12 +++- .../client/models/dag_run_response.py | 2 +- docs/BulkAction.md | 15 ----- docs/BulkBodyConnectionBodyActionsInner.md | 2 +- docs/BulkBodyPoolBodyActionsInner.md | 2 +- docs/BulkBodyVariableBodyActionsInner.md | 2 +- docs/BulkCreateActionConnectionBody.md | 2 +- docs/BulkCreateActionPoolBody.md | 2 +- docs/BulkCreateActionVariableBody.md | 2 +- docs/BulkDeleteActionConnectionBody.md | 2 +- docs/BulkDeleteActionPoolBody.md | 2 +- docs/BulkDeleteActionVariableBody.md | 2 +- docs/BulkUpdateActionConnectionBody.md | 2 +- docs/BulkUpdateActionPoolBody.md | 2 +- docs/BulkUpdateActionVariableBody.md | 2 +- docs/DAGApi.md | 7 +-- docs/DAGRunResponse.md | 2 +- docs/ResponseClearDagRun.md | 2 +- docs/TaskInstanceApi.md | 2 +- pyproject.toml | 4 +- spec/v2.yaml | 61 ++++++++++--------- test/test_bulk_action.py | 33 ---------- ...bulk_body_connection_body_actions_inner.py | 4 +- .../test_bulk_body_pool_body_actions_inner.py | 4 +- ...t_bulk_body_variable_body_actions_inner.py | 4 +- ...test_bulk_delete_action_connection_body.py | 4 +- test/test_bulk_delete_action_pool_body.py | 4 +- test/test_bulk_delete_action_variable_body.py | 4 +- ...test_bulk_update_action_connection_body.py | 4 +- test/test_bulk_update_action_pool_body.py | 4 +- test/test_bulk_update_action_variable_body.py | 4 +- test/test_dag_run_collection_response.py | 4 +- test/test_dag_run_response.py | 3 +- test/test_response_clear_dag_run.py | 3 +- version.txt | 2 +- 51 files changed, 179 insertions(+), 212 deletions(-) delete mode 100644 airflow_client/client/models/bulk_action.py delete mode 100644 docs/BulkAction.md delete mode 100644 test/test_bulk_action.py diff --git a/CHANGELOG.md b/CHANGELOG.md index d44d7d8f..095e52c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,24 @@ under the License. --> +# v3.0.2 + +## Major changes: + +- Add `owner_links` field to DAGDetailsResponse ([#50557](https://github.com/apache/airflow/pull/50557)) +- Allow non-string valid JSON values in Variable import ([#49844](https://github.com/apache/airflow/pull/49844)) +- Add `bundle_version` to DagRun response ([#49726](https://github.com/apache/airflow/pull/49726)) +- Use `NonNegativeInt` for `backfill_id` ([#49691](https://github.com/apache/airflow/pull/49691)) +- Rename operation IDs for task instance endpoints to include map indexes ([#49608](https://github.com/apache/airflow/pull/49608)) +- Remove filtering by last dag run state in patch dags endpoint ([#51176](https://github.com/apache/airflow/pull/51176)) +- Make `dag_run` nullable in Details page ([#50719](https://github.com/apache/airflow/pull/50719)) + +## Bug Fixes + +- Fix OpenAPI schema for `get_log` API ([#50547](https://github.com/apache/airflow/pull/50547)) +- Fix bulk action annotation ([#50852](https://github.com/apache/airflow/pull/50852)) +- Fix `patch_task_instance` endpoint ([#50550](https://github.com/apache/airflow/pull/50550)) + # v3.0.0 This is the first release of the **Airflow 3.0.0** Python client. It introduces compatibility with the new [Airflow 3.0 REST API](https://airflow.apache.org/docs/apache-airflow/3.0.0/stable-rest-api-ref.html), and includes several **breaking changes** and behavior updates. diff --git a/airflow_client/client/__init__.py b/airflow_client/client/__init__.py index e596e440..07e883ba 100644 --- a/airflow_client/client/__init__.py +++ b/airflow_client/client/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "3.0.0" +__version__ = "3.0.2" # import apis into sdk package from airflow_client.client.api.asset_api import AssetApi @@ -68,7 +68,6 @@ from airflow_client.client.models.backfill_post_body import BackfillPostBody from airflow_client.client.models.backfill_response import BackfillResponse from airflow_client.client.models.base_info_response import BaseInfoResponse -from airflow_client.client.models.bulk_action import BulkAction from airflow_client.client.models.bulk_action_not_on_existence import BulkActionNotOnExistence from airflow_client.client.models.bulk_action_on_existence import BulkActionOnExistence from airflow_client.client.models.bulk_action_response import BulkActionResponse diff --git a/airflow_client/client/api/dag_api.py b/airflow_client/client/api/dag_api.py index d8b3bedc..019ec28c 100644 --- a/airflow_client/client/api/dag_api.py +++ b/airflow_client/client/api/dag_api.py @@ -2097,7 +2097,6 @@ def patch_dags( dag_id_pattern: Optional[StrictStr] = None, exclude_stale: Optional[StrictBool] = None, paused: Optional[StrictBool] = None, - last_dag_run_state: Optional[DagRunState] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2135,8 +2134,6 @@ def patch_dags( :type exclude_stale: bool :param paused: :type paused: bool - :param last_dag_run_state: - :type last_dag_run_state: DagRunState :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2170,7 +2167,6 @@ def patch_dags( dag_id_pattern=dag_id_pattern, exclude_stale=exclude_stale, paused=paused, - last_dag_run_state=last_dag_run_state, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2209,7 +2205,6 @@ def patch_dags_with_http_info( dag_id_pattern: Optional[StrictStr] = None, exclude_stale: Optional[StrictBool] = None, paused: Optional[StrictBool] = None, - last_dag_run_state: Optional[DagRunState] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2247,8 +2242,6 @@ def patch_dags_with_http_info( :type exclude_stale: bool :param paused: :type paused: bool - :param last_dag_run_state: - :type last_dag_run_state: DagRunState :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2282,7 +2275,6 @@ def patch_dags_with_http_info( dag_id_pattern=dag_id_pattern, exclude_stale=exclude_stale, paused=paused, - last_dag_run_state=last_dag_run_state, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2321,7 +2313,6 @@ def patch_dags_without_preload_content( dag_id_pattern: Optional[StrictStr] = None, exclude_stale: Optional[StrictBool] = None, paused: Optional[StrictBool] = None, - last_dag_run_state: Optional[DagRunState] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2359,8 +2350,6 @@ def patch_dags_without_preload_content( :type exclude_stale: bool :param paused: :type paused: bool - :param last_dag_run_state: - :type last_dag_run_state: DagRunState :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2394,7 +2383,6 @@ def patch_dags_without_preload_content( dag_id_pattern=dag_id_pattern, exclude_stale=exclude_stale, paused=paused, - last_dag_run_state=last_dag_run_state, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2428,7 +2416,6 @@ def _patch_dags_serialize( dag_id_pattern, exclude_stale, paused, - last_dag_run_state, _request_auth, _content_type, _headers, @@ -2490,10 +2477,6 @@ def _patch_dags_serialize( _query_params.append(('paused', paused)) - if last_dag_run_state is not None: - - _query_params.append(('last_dag_run_state', last_dag_run_state.value)) - # process the header parameters # process the form parameters # process the body parameter diff --git a/airflow_client/client/api/task_instance_api.py b/airflow_client/client/api/task_instance_api.py index 11d4ac15..fcbbb7e6 100644 --- a/airflow_client/client/api/task_instance_api.py +++ b/airflow_client/client/api/task_instance_api.py @@ -726,7 +726,7 @@ def _get_log_serialize( _header_params['Accept'] = self.api_client.select_header_accept( [ 'application/json', - 'text/plain' + 'application/x-ndjson' ] ) diff --git a/airflow_client/client/api_client.py b/airflow_client/client/api_client.py index f3c9816f..5e088299 100644 --- a/airflow_client/client/api_client.py +++ b/airflow_client/client/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/3.0.0/python' + self.user_agent = 'OpenAPI-Generator/3.0.2/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/airflow_client/client/configuration.py b/airflow_client/client/configuration.py index 64146208..97061cdc 100644 --- a/airflow_client/client/configuration.py +++ b/airflow_client/client/configuration.py @@ -510,7 +510,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 2\n"\ - "SDK Package Version: 3.0.0".\ + "SDK Package Version: 3.0.2".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/airflow_client/client/models/__init__.py b/airflow_client/client/models/__init__.py index fe07d0c0..69ba66d1 100644 --- a/airflow_client/client/models/__init__.py +++ b/airflow_client/client/models/__init__.py @@ -26,7 +26,6 @@ from airflow_client.client.models.backfill_post_body import BackfillPostBody from airflow_client.client.models.backfill_response import BackfillResponse from airflow_client.client.models.base_info_response import BaseInfoResponse -from airflow_client.client.models.bulk_action import BulkAction from airflow_client.client.models.bulk_action_not_on_existence import BulkActionNotOnExistence from airflow_client.client.models.bulk_action_on_existence import BulkActionOnExistence from airflow_client.client.models.bulk_action_response import BulkActionResponse diff --git a/airflow_client/client/models/bulk_action.py b/airflow_client/client/models/bulk_action.py deleted file mode 100644 index 99a34aec..00000000 --- a/airflow_client/client/models/bulk_action.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - Airflow API - - Airflow API. All endpoints located under ``/api/v2`` can be used safely, are stable and backward compatible. Endpoints located under ``/ui`` are dedicated to the UI and are subject to breaking change depending on the need of the frontend. Users should not rely on those but use the public ones instead. - - The version of the OpenAPI document: 2 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class BulkAction(str, Enum): - """ - Bulk Action to be performed on the used model. - """ - - """ - allowed enum values - """ - CREATE = 'create' - DELETE = 'delete' - UPDATE = 'update' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BulkAction from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/airflow_client/client/models/bulk_create_action_connection_body.py b/airflow_client/client/models/bulk_create_action_connection_body.py index 9e5773d8..fde17d29 100644 --- a/airflow_client/client/models/bulk_create_action_connection_body.py +++ b/airflow_client/client/models/bulk_create_action_connection_body.py @@ -17,9 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from airflow_client.client.models.bulk_action import BulkAction from airflow_client.client.models.bulk_action_on_existence import BulkActionOnExistence from airflow_client.client.models.connection_body import ConnectionBody from typing import Optional, Set @@ -29,11 +28,18 @@ class BulkCreateActionConnectionBody(BaseModel): """ BulkCreateActionConnectionBody """ # noqa: E501 - action: BulkAction = Field(description="The action to be performed on the entities.") + action: StrictStr = Field(description="The action to be performed on the entities.") action_on_existence: Optional[BulkActionOnExistence] = None entities: List[ConnectionBody] = Field(description="A list of entities to be created.") __properties: ClassVar[List[str]] = ["action", "action_on_existence", "entities"] + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['create']): + raise ValueError("must be one of enum values ('create')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/airflow_client/client/models/bulk_create_action_pool_body.py b/airflow_client/client/models/bulk_create_action_pool_body.py index 77597b9f..0f936c07 100644 --- a/airflow_client/client/models/bulk_create_action_pool_body.py +++ b/airflow_client/client/models/bulk_create_action_pool_body.py @@ -17,9 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from airflow_client.client.models.bulk_action import BulkAction from airflow_client.client.models.bulk_action_on_existence import BulkActionOnExistence from airflow_client.client.models.pool_body import PoolBody from typing import Optional, Set @@ -29,11 +28,18 @@ class BulkCreateActionPoolBody(BaseModel): """ BulkCreateActionPoolBody """ # noqa: E501 - action: BulkAction = Field(description="The action to be performed on the entities.") + action: StrictStr = Field(description="The action to be performed on the entities.") action_on_existence: Optional[BulkActionOnExistence] = None entities: List[PoolBody] = Field(description="A list of entities to be created.") __properties: ClassVar[List[str]] = ["action", "action_on_existence", "entities"] + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['create']): + raise ValueError("must be one of enum values ('create')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/airflow_client/client/models/bulk_create_action_variable_body.py b/airflow_client/client/models/bulk_create_action_variable_body.py index d813ae16..8f056bd3 100644 --- a/airflow_client/client/models/bulk_create_action_variable_body.py +++ b/airflow_client/client/models/bulk_create_action_variable_body.py @@ -17,9 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from airflow_client.client.models.bulk_action import BulkAction from airflow_client.client.models.bulk_action_on_existence import BulkActionOnExistence from airflow_client.client.models.variable_body import VariableBody from typing import Optional, Set @@ -29,11 +28,18 @@ class BulkCreateActionVariableBody(BaseModel): """ BulkCreateActionVariableBody """ # noqa: E501 - action: BulkAction = Field(description="The action to be performed on the entities.") + action: StrictStr = Field(description="The action to be performed on the entities.") action_on_existence: Optional[BulkActionOnExistence] = None entities: List[VariableBody] = Field(description="A list of entities to be created.") __properties: ClassVar[List[str]] = ["action", "action_on_existence", "entities"] + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['create']): + raise ValueError("must be one of enum values ('create')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/airflow_client/client/models/bulk_delete_action_connection_body.py b/airflow_client/client/models/bulk_delete_action_connection_body.py index f3e4dad9..a8f86925 100644 --- a/airflow_client/client/models/bulk_delete_action_connection_body.py +++ b/airflow_client/client/models/bulk_delete_action_connection_body.py @@ -17,9 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from airflow_client.client.models.bulk_action import BulkAction from airflow_client.client.models.bulk_action_not_on_existence import BulkActionNotOnExistence from typing import Optional, Set from typing_extensions import Self @@ -28,11 +27,18 @@ class BulkDeleteActionConnectionBody(BaseModel): """ BulkDeleteActionConnectionBody """ # noqa: E501 - action: BulkAction = Field(description="The action to be performed on the entities.") + action: StrictStr = Field(description="The action to be performed on the entities.") action_on_non_existence: Optional[BulkActionNotOnExistence] = None entities: List[StrictStr] = Field(description="A list of entity id/key to be deleted.") __properties: ClassVar[List[str]] = ["action", "action_on_non_existence", "entities"] + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['delete']): + raise ValueError("must be one of enum values ('delete')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/airflow_client/client/models/bulk_delete_action_pool_body.py b/airflow_client/client/models/bulk_delete_action_pool_body.py index 9c1f33a3..b25d6a20 100644 --- a/airflow_client/client/models/bulk_delete_action_pool_body.py +++ b/airflow_client/client/models/bulk_delete_action_pool_body.py @@ -17,9 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from airflow_client.client.models.bulk_action import BulkAction from airflow_client.client.models.bulk_action_not_on_existence import BulkActionNotOnExistence from typing import Optional, Set from typing_extensions import Self @@ -28,11 +27,18 @@ class BulkDeleteActionPoolBody(BaseModel): """ BulkDeleteActionPoolBody """ # noqa: E501 - action: BulkAction = Field(description="The action to be performed on the entities.") + action: StrictStr = Field(description="The action to be performed on the entities.") action_on_non_existence: Optional[BulkActionNotOnExistence] = None entities: List[StrictStr] = Field(description="A list of entity id/key to be deleted.") __properties: ClassVar[List[str]] = ["action", "action_on_non_existence", "entities"] + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['delete']): + raise ValueError("must be one of enum values ('delete')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/airflow_client/client/models/bulk_delete_action_variable_body.py b/airflow_client/client/models/bulk_delete_action_variable_body.py index f4e7f5a2..358529d3 100644 --- a/airflow_client/client/models/bulk_delete_action_variable_body.py +++ b/airflow_client/client/models/bulk_delete_action_variable_body.py @@ -17,9 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from airflow_client.client.models.bulk_action import BulkAction from airflow_client.client.models.bulk_action_not_on_existence import BulkActionNotOnExistence from typing import Optional, Set from typing_extensions import Self @@ -28,11 +27,18 @@ class BulkDeleteActionVariableBody(BaseModel): """ BulkDeleteActionVariableBody """ # noqa: E501 - action: BulkAction = Field(description="The action to be performed on the entities.") + action: StrictStr = Field(description="The action to be performed on the entities.") action_on_non_existence: Optional[BulkActionNotOnExistence] = None entities: List[StrictStr] = Field(description="A list of entity id/key to be deleted.") __properties: ClassVar[List[str]] = ["action", "action_on_non_existence", "entities"] + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['delete']): + raise ValueError("must be one of enum values ('delete')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/airflow_client/client/models/bulk_update_action_connection_body.py b/airflow_client/client/models/bulk_update_action_connection_body.py index fc8957a3..ad1ff1a2 100644 --- a/airflow_client/client/models/bulk_update_action_connection_body.py +++ b/airflow_client/client/models/bulk_update_action_connection_body.py @@ -17,9 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from airflow_client.client.models.bulk_action import BulkAction from airflow_client.client.models.bulk_action_not_on_existence import BulkActionNotOnExistence from airflow_client.client.models.connection_body import ConnectionBody from typing import Optional, Set @@ -29,11 +28,18 @@ class BulkUpdateActionConnectionBody(BaseModel): """ BulkUpdateActionConnectionBody """ # noqa: E501 - action: BulkAction = Field(description="The action to be performed on the entities.") + action: StrictStr = Field(description="The action to be performed on the entities.") action_on_non_existence: Optional[BulkActionNotOnExistence] = None entities: List[ConnectionBody] = Field(description="A list of entities to be updated.") __properties: ClassVar[List[str]] = ["action", "action_on_non_existence", "entities"] + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['update']): + raise ValueError("must be one of enum values ('update')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/airflow_client/client/models/bulk_update_action_pool_body.py b/airflow_client/client/models/bulk_update_action_pool_body.py index 975b5808..de947ead 100644 --- a/airflow_client/client/models/bulk_update_action_pool_body.py +++ b/airflow_client/client/models/bulk_update_action_pool_body.py @@ -17,9 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from airflow_client.client.models.bulk_action import BulkAction from airflow_client.client.models.bulk_action_not_on_existence import BulkActionNotOnExistence from airflow_client.client.models.pool_body import PoolBody from typing import Optional, Set @@ -29,11 +28,18 @@ class BulkUpdateActionPoolBody(BaseModel): """ BulkUpdateActionPoolBody """ # noqa: E501 - action: BulkAction = Field(description="The action to be performed on the entities.") + action: StrictStr = Field(description="The action to be performed on the entities.") action_on_non_existence: Optional[BulkActionNotOnExistence] = None entities: List[PoolBody] = Field(description="A list of entities to be updated.") __properties: ClassVar[List[str]] = ["action", "action_on_non_existence", "entities"] + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['update']): + raise ValueError("must be one of enum values ('update')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/airflow_client/client/models/bulk_update_action_variable_body.py b/airflow_client/client/models/bulk_update_action_variable_body.py index dc17aa39..be071ff7 100644 --- a/airflow_client/client/models/bulk_update_action_variable_body.py +++ b/airflow_client/client/models/bulk_update_action_variable_body.py @@ -17,9 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from airflow_client.client.models.bulk_action import BulkAction from airflow_client.client.models.bulk_action_not_on_existence import BulkActionNotOnExistence from airflow_client.client.models.variable_body import VariableBody from typing import Optional, Set @@ -29,11 +28,18 @@ class BulkUpdateActionVariableBody(BaseModel): """ BulkUpdateActionVariableBody """ # noqa: E501 - action: BulkAction = Field(description="The action to be performed on the entities.") + action: StrictStr = Field(description="The action to be performed on the entities.") action_on_non_existence: Optional[BulkActionNotOnExistence] = None entities: List[VariableBody] = Field(description="A list of entities to be updated.") __properties: ClassVar[List[str]] = ["action", "action_on_non_existence", "entities"] + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['update']): + raise ValueError("must be one of enum values ('update')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/airflow_client/client/models/dag_run_response.py b/airflow_client/client/models/dag_run_response.py index 9da74c68..3a6fbd46 100644 --- a/airflow_client/client/models/dag_run_response.py +++ b/airflow_client/client/models/dag_run_response.py @@ -32,7 +32,7 @@ class DAGRunResponse(BaseModel): DAG Run serializer for responses. """ # noqa: E501 bundle_version: Optional[StrictStr] = None - conf: Dict[str, Any] + conf: Optional[Dict[str, Any]] = None dag_id: StrictStr dag_run_id: StrictStr dag_versions: List[DagVersionResponse] diff --git a/docs/BulkAction.md b/docs/BulkAction.md deleted file mode 100644 index 05578be8..00000000 --- a/docs/BulkAction.md +++ /dev/null @@ -1,15 +0,0 @@ -# BulkAction - -Bulk Action to be performed on the used model. - -## Enum - -* `CREATE` (value: `'create'`) - -* `DELETE` (value: `'delete'`) - -* `UPDATE` (value: `'update'`) - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BulkBodyConnectionBodyActionsInner.md b/docs/BulkBodyConnectionBodyActionsInner.md index a6a0fd0c..05981089 100644 --- a/docs/BulkBodyConnectionBodyActionsInner.md +++ b/docs/BulkBodyConnectionBodyActionsInner.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**BulkAction**](BulkAction.md) | The action to be performed on the entities. | +**action** | **str** | The action to be performed on the entities. | **action_on_existence** | [**BulkActionOnExistence**](BulkActionOnExistence.md) | | [optional] **entities** | **List[str]** | A list of entity id/key to be deleted. | **action_on_non_existence** | [**BulkActionNotOnExistence**](BulkActionNotOnExistence.md) | | [optional] diff --git a/docs/BulkBodyPoolBodyActionsInner.md b/docs/BulkBodyPoolBodyActionsInner.md index b5dbbe89..23e1da66 100644 --- a/docs/BulkBodyPoolBodyActionsInner.md +++ b/docs/BulkBodyPoolBodyActionsInner.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**BulkAction**](BulkAction.md) | The action to be performed on the entities. | +**action** | **str** | The action to be performed on the entities. | **action_on_existence** | [**BulkActionOnExistence**](BulkActionOnExistence.md) | | [optional] **entities** | **List[str]** | A list of entity id/key to be deleted. | **action_on_non_existence** | [**BulkActionNotOnExistence**](BulkActionNotOnExistence.md) | | [optional] diff --git a/docs/BulkBodyVariableBodyActionsInner.md b/docs/BulkBodyVariableBodyActionsInner.md index 62d5be46..379083bb 100644 --- a/docs/BulkBodyVariableBodyActionsInner.md +++ b/docs/BulkBodyVariableBodyActionsInner.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**BulkAction**](BulkAction.md) | The action to be performed on the entities. | +**action** | **str** | The action to be performed on the entities. | **action_on_existence** | [**BulkActionOnExistence**](BulkActionOnExistence.md) | | [optional] **entities** | **List[str]** | A list of entity id/key to be deleted. | **action_on_non_existence** | [**BulkActionNotOnExistence**](BulkActionNotOnExistence.md) | | [optional] diff --git a/docs/BulkCreateActionConnectionBody.md b/docs/BulkCreateActionConnectionBody.md index 4c79fe14..315f0174 100644 --- a/docs/BulkCreateActionConnectionBody.md +++ b/docs/BulkCreateActionConnectionBody.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**BulkAction**](BulkAction.md) | The action to be performed on the entities. | +**action** | **str** | The action to be performed on the entities. | **action_on_existence** | [**BulkActionOnExistence**](BulkActionOnExistence.md) | | [optional] **entities** | [**List[ConnectionBody]**](ConnectionBody.md) | A list of entities to be created. | diff --git a/docs/BulkCreateActionPoolBody.md b/docs/BulkCreateActionPoolBody.md index 80350d0f..25b7969a 100644 --- a/docs/BulkCreateActionPoolBody.md +++ b/docs/BulkCreateActionPoolBody.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**BulkAction**](BulkAction.md) | The action to be performed on the entities. | +**action** | **str** | The action to be performed on the entities. | **action_on_existence** | [**BulkActionOnExistence**](BulkActionOnExistence.md) | | [optional] **entities** | [**List[PoolBody]**](PoolBody.md) | A list of entities to be created. | diff --git a/docs/BulkCreateActionVariableBody.md b/docs/BulkCreateActionVariableBody.md index 69b54025..34435b82 100644 --- a/docs/BulkCreateActionVariableBody.md +++ b/docs/BulkCreateActionVariableBody.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**BulkAction**](BulkAction.md) | The action to be performed on the entities. | +**action** | **str** | The action to be performed on the entities. | **action_on_existence** | [**BulkActionOnExistence**](BulkActionOnExistence.md) | | [optional] **entities** | [**List[VariableBody]**](VariableBody.md) | A list of entities to be created. | diff --git a/docs/BulkDeleteActionConnectionBody.md b/docs/BulkDeleteActionConnectionBody.md index 8af938cc..026de47c 100644 --- a/docs/BulkDeleteActionConnectionBody.md +++ b/docs/BulkDeleteActionConnectionBody.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**BulkAction**](BulkAction.md) | The action to be performed on the entities. | +**action** | **str** | The action to be performed on the entities. | **action_on_non_existence** | [**BulkActionNotOnExistence**](BulkActionNotOnExistence.md) | | [optional] **entities** | **List[str]** | A list of entity id/key to be deleted. | diff --git a/docs/BulkDeleteActionPoolBody.md b/docs/BulkDeleteActionPoolBody.md index 51673057..0974ea0f 100644 --- a/docs/BulkDeleteActionPoolBody.md +++ b/docs/BulkDeleteActionPoolBody.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**BulkAction**](BulkAction.md) | The action to be performed on the entities. | +**action** | **str** | The action to be performed on the entities. | **action_on_non_existence** | [**BulkActionNotOnExistence**](BulkActionNotOnExistence.md) | | [optional] **entities** | **List[str]** | A list of entity id/key to be deleted. | diff --git a/docs/BulkDeleteActionVariableBody.md b/docs/BulkDeleteActionVariableBody.md index 048cc081..e2802df5 100644 --- a/docs/BulkDeleteActionVariableBody.md +++ b/docs/BulkDeleteActionVariableBody.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**BulkAction**](BulkAction.md) | The action to be performed on the entities. | +**action** | **str** | The action to be performed on the entities. | **action_on_non_existence** | [**BulkActionNotOnExistence**](BulkActionNotOnExistence.md) | | [optional] **entities** | **List[str]** | A list of entity id/key to be deleted. | diff --git a/docs/BulkUpdateActionConnectionBody.md b/docs/BulkUpdateActionConnectionBody.md index 336a1169..53494a07 100644 --- a/docs/BulkUpdateActionConnectionBody.md +++ b/docs/BulkUpdateActionConnectionBody.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**BulkAction**](BulkAction.md) | The action to be performed on the entities. | +**action** | **str** | The action to be performed on the entities. | **action_on_non_existence** | [**BulkActionNotOnExistence**](BulkActionNotOnExistence.md) | | [optional] **entities** | [**List[ConnectionBody]**](ConnectionBody.md) | A list of entities to be updated. | diff --git a/docs/BulkUpdateActionPoolBody.md b/docs/BulkUpdateActionPoolBody.md index 590bae2c..284c94b4 100644 --- a/docs/BulkUpdateActionPoolBody.md +++ b/docs/BulkUpdateActionPoolBody.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**BulkAction**](BulkAction.md) | The action to be performed on the entities. | +**action** | **str** | The action to be performed on the entities. | **action_on_non_existence** | [**BulkActionNotOnExistence**](BulkActionNotOnExistence.md) | | [optional] **entities** | [**List[PoolBody]**](PoolBody.md) | A list of entities to be updated. | diff --git a/docs/BulkUpdateActionVariableBody.md b/docs/BulkUpdateActionVariableBody.md index 644838b1..c8117545 100644 --- a/docs/BulkUpdateActionVariableBody.md +++ b/docs/BulkUpdateActionVariableBody.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**BulkAction**](BulkAction.md) | The action to be performed on the entities. | +**action** | **str** | The action to be performed on the entities. | **action_on_non_existence** | [**BulkActionNotOnExistence**](BulkActionNotOnExistence.md) | | [optional] **entities** | [**List[VariableBody]**](VariableBody.md) | A list of entities to be updated. | diff --git a/docs/DAGApi.md b/docs/DAGApi.md index 91482688..32f0f7ab 100644 --- a/docs/DAGApi.md +++ b/docs/DAGApi.md @@ -531,7 +531,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **patch_dags** -> DAGCollectionResponse patch_dags(dag_patch_body, update_mask=update_mask, limit=limit, offset=offset, tags=tags, tags_match_mode=tags_match_mode, owners=owners, dag_id_pattern=dag_id_pattern, exclude_stale=exclude_stale, paused=paused, last_dag_run_state=last_dag_run_state) +> DAGCollectionResponse patch_dags(dag_patch_body, update_mask=update_mask, limit=limit, offset=offset, tags=tags, tags_match_mode=tags_match_mode, owners=owners, dag_id_pattern=dag_id_pattern, exclude_stale=exclude_stale, paused=paused) Patch Dags @@ -545,7 +545,6 @@ Patch multiple DAGs. import airflow_client.client from airflow_client.client.models.dag_collection_response import DAGCollectionResponse from airflow_client.client.models.dag_patch_body import DAGPatchBody -from airflow_client.client.models.dag_run_state import DagRunState from airflow_client.client.rest import ApiException from pprint import pprint @@ -576,11 +575,10 @@ with airflow_client.client.ApiClient(configuration) as api_client: dag_id_pattern = 'dag_id_pattern_example' # str | (optional) exclude_stale = True # bool | (optional) (default to True) paused = True # bool | (optional) - last_dag_run_state = airflow_client.client.DagRunState() # DagRunState | (optional) try: # Patch Dags - api_response = api_instance.patch_dags(dag_patch_body, update_mask=update_mask, limit=limit, offset=offset, tags=tags, tags_match_mode=tags_match_mode, owners=owners, dag_id_pattern=dag_id_pattern, exclude_stale=exclude_stale, paused=paused, last_dag_run_state=last_dag_run_state) + api_response = api_instance.patch_dags(dag_patch_body, update_mask=update_mask, limit=limit, offset=offset, tags=tags, tags_match_mode=tags_match_mode, owners=owners, dag_id_pattern=dag_id_pattern, exclude_stale=exclude_stale, paused=paused) print("The response of DAGApi->patch_dags:\n") pprint(api_response) except Exception as e: @@ -604,7 +602,6 @@ Name | Type | Description | Notes **dag_id_pattern** | **str**| | [optional] **exclude_stale** | **bool**| | [optional] [default to True] **paused** | **bool**| | [optional] - **last_dag_run_state** | [**DagRunState**](.md)| | [optional] ### Return type diff --git a/docs/DAGRunResponse.md b/docs/DAGRunResponse.md index 61b4893c..35452630 100644 --- a/docs/DAGRunResponse.md +++ b/docs/DAGRunResponse.md @@ -7,7 +7,7 @@ DAG Run serializer for responses. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bundle_version** | **str** | | [optional] -**conf** | **object** | | +**conf** | **object** | | [optional] **dag_id** | **str** | | **dag_run_id** | **str** | | **dag_versions** | [**List[DagVersionResponse]**](DagVersionResponse.md) | | diff --git a/docs/ResponseClearDagRun.md b/docs/ResponseClearDagRun.md index 549fc0a6..650ac08f 100644 --- a/docs/ResponseClearDagRun.md +++ b/docs/ResponseClearDagRun.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **task_instances** | [**List[TaskInstanceResponse]**](TaskInstanceResponse.md) | | **total_entries** | **int** | | **bundle_version** | **str** | | [optional] -**conf** | **object** | | +**conf** | **object** | | [optional] **dag_id** | **str** | | **dag_run_id** | **str** | | **dag_versions** | [**List[DagVersionResponse]**](DagVersionResponse.md) | | diff --git a/docs/TaskInstanceApi.md b/docs/TaskInstanceApi.md index f1f7cf3a..eae906b7 100644 --- a/docs/TaskInstanceApi.md +++ b/docs/TaskInstanceApi.md @@ -188,7 +188,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, text/plain + - **Accept**: application/json, application/x-ndjson ### HTTP response details diff --git a/pyproject.toml b/pyproject.toml index a92844c8..ec4baeb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,7 +84,7 @@ artifacts = [ "/airflow_client", "/docs", "/test", - "v2.yaml", + "v1.yaml", ] include = [ "version.txt", @@ -97,7 +97,7 @@ artifacts = [ "/airflow_client", "/docs", "/test", - "v2.yaml", + "v1.yaml", ] include = [ "/airflow_client", diff --git a/spec/v2.yaml b/spec/v2.yaml index 279a2734..6edaab2b 100644 --- a/spec/v2.yaml +++ b/spec/v2.yaml @@ -323,14 +323,6 @@ components: required: [] title: BaseInfoResponse type: object - BulkAction: - description: Bulk Action to be performed on the used model. - enum: - - create - - delete - - update - title: BulkAction - type: string BulkActionNotOnExistence: description: Bulk Action to be taken if the entity does not exist. enum: @@ -425,8 +417,10 @@ components: additionalProperties: false properties: action: - $ref: '#/components/schemas/BulkAction' + const: create description: The action to be performed on the entities. + title: Action + type: string action_on_existence: $ref: '#/components/schemas/BulkActionOnExistence' default: fail @@ -445,8 +439,10 @@ components: additionalProperties: false properties: action: - $ref: '#/components/schemas/BulkAction' + const: create description: The action to be performed on the entities. + title: Action + type: string action_on_existence: $ref: '#/components/schemas/BulkActionOnExistence' default: fail @@ -465,8 +461,10 @@ components: additionalProperties: false properties: action: - $ref: '#/components/schemas/BulkAction' + const: create description: The action to be performed on the entities. + title: Action + type: string action_on_existence: $ref: '#/components/schemas/BulkActionOnExistence' default: fail @@ -485,8 +483,10 @@ components: additionalProperties: false properties: action: - $ref: '#/components/schemas/BulkAction' + const: delete description: The action to be performed on the entities. + title: Action + type: string action_on_non_existence: $ref: '#/components/schemas/BulkActionNotOnExistence' default: fail @@ -505,8 +505,10 @@ components: additionalProperties: false properties: action: - $ref: '#/components/schemas/BulkAction' + const: delete description: The action to be performed on the entities. + title: Action + type: string action_on_non_existence: $ref: '#/components/schemas/BulkActionNotOnExistence' default: fail @@ -525,8 +527,10 @@ components: additionalProperties: false properties: action: - $ref: '#/components/schemas/BulkAction' + const: delete description: The action to be performed on the entities. + title: Action + type: string action_on_non_existence: $ref: '#/components/schemas/BulkActionNotOnExistence' default: fail @@ -569,8 +573,10 @@ components: additionalProperties: false properties: action: - $ref: '#/components/schemas/BulkAction' + const: update description: The action to be performed on the entities. + title: Action + type: string action_on_non_existence: $ref: '#/components/schemas/BulkActionNotOnExistence' default: fail @@ -589,8 +595,10 @@ components: additionalProperties: false properties: action: - $ref: '#/components/schemas/BulkAction' + const: update description: The action to be performed on the entities. + title: Action + type: string action_on_non_existence: $ref: '#/components/schemas/BulkActionNotOnExistence' default: fail @@ -609,8 +617,10 @@ components: additionalProperties: false properties: action: - $ref: '#/components/schemas/BulkAction' + const: update description: The action to be performed on the entities. + title: Action + type: string action_on_non_existence: $ref: '#/components/schemas/BulkActionNotOnExistence' default: fail @@ -1212,7 +1222,7 @@ components: type: string conf: additionalProperties: true - title: Conf + nullable: true type: object dag_id: title: Dag Id @@ -1273,7 +1283,6 @@ components: - run_after - run_type - state - - conf - dag_versions title: DAGRunResponse type: object @@ -5232,12 +5241,6 @@ paths: schema: nullable: true type: boolean - - in: query - name: last_dag_run_state - required: false - schema: - $ref: '#/components/schemas/DagRunState' - nullable: true requestBody: content: application/json: @@ -7155,7 +7158,7 @@ paths: default: '*/*' enum: - application/json - - text/plain + - application/x-ndjson - '*/*' title: Accept type: string @@ -7165,9 +7168,11 @@ paths: application/json: schema: $ref: '#/components/schemas/TaskInstancesLogResponse' - text/plain: + application/x-ndjson: schema: - example: 'content + example: '{"content": "content"} + + {"content": "content"} ' type: string diff --git a/test/test_bulk_action.py b/test/test_bulk_action.py deleted file mode 100644 index 0943bd35..00000000 --- a/test/test_bulk_action.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - Airflow API - - Airflow API. All endpoints located under ``/api/v2`` can be used safely, are stable and backward compatible. Endpoints located under ``/ui`` are dedicated to the UI and are subject to breaking change depending on the need of the frontend. Users should not rely on those but use the public ones instead. - - The version of the OpenAPI document: 2 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from airflow_client.client.models.bulk_action import BulkAction - -class TestBulkAction(unittest.TestCase): - """BulkAction unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBulkAction(self): - """Test BulkAction""" - # inst = BulkAction() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_bulk_body_connection_body_actions_inner.py b/test/test_bulk_body_connection_body_actions_inner.py index f4651eca..780238df 100644 --- a/test/test_bulk_body_connection_body_actions_inner.py +++ b/test/test_bulk_body_connection_body_actions_inner.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> BulkBodyConnectionBodyActionsInner: model = BulkBodyConnectionBodyActionsInner() if include_optional: return BulkBodyConnectionBodyActionsInner( - action = 'create', + action = 'delete', action_on_existence = 'fail', entities = [ '' @@ -44,7 +44,7 @@ def make_instance(self, include_optional) -> BulkBodyConnectionBodyActionsInner: ) else: return BulkBodyConnectionBodyActionsInner( - action = 'create', + action = 'delete', entities = [ '' ], diff --git a/test/test_bulk_body_pool_body_actions_inner.py b/test/test_bulk_body_pool_body_actions_inner.py index 20e38bf5..c17dee25 100644 --- a/test/test_bulk_body_pool_body_actions_inner.py +++ b/test/test_bulk_body_pool_body_actions_inner.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> BulkBodyPoolBodyActionsInner: model = BulkBodyPoolBodyActionsInner() if include_optional: return BulkBodyPoolBodyActionsInner( - action = 'create', + action = 'delete', action_on_existence = 'fail', entities = [ '' @@ -44,7 +44,7 @@ def make_instance(self, include_optional) -> BulkBodyPoolBodyActionsInner: ) else: return BulkBodyPoolBodyActionsInner( - action = 'create', + action = 'delete', entities = [ '' ], diff --git a/test/test_bulk_body_variable_body_actions_inner.py b/test/test_bulk_body_variable_body_actions_inner.py index ce4f7dfd..122d5d49 100644 --- a/test/test_bulk_body_variable_body_actions_inner.py +++ b/test/test_bulk_body_variable_body_actions_inner.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> BulkBodyVariableBodyActionsInner: model = BulkBodyVariableBodyActionsInner() if include_optional: return BulkBodyVariableBodyActionsInner( - action = 'create', + action = 'delete', action_on_existence = 'fail', entities = [ '' @@ -44,7 +44,7 @@ def make_instance(self, include_optional) -> BulkBodyVariableBodyActionsInner: ) else: return BulkBodyVariableBodyActionsInner( - action = 'create', + action = 'delete', entities = [ '' ], diff --git a/test/test_bulk_delete_action_connection_body.py b/test/test_bulk_delete_action_connection_body.py index 49dbff9d..b9b78234 100644 --- a/test/test_bulk_delete_action_connection_body.py +++ b/test/test_bulk_delete_action_connection_body.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> BulkDeleteActionConnectionBody: model = BulkDeleteActionConnectionBody() if include_optional: return BulkDeleteActionConnectionBody( - action = 'create', + action = 'delete', action_on_non_existence = 'fail', entities = [ '' @@ -43,7 +43,7 @@ def make_instance(self, include_optional) -> BulkDeleteActionConnectionBody: ) else: return BulkDeleteActionConnectionBody( - action = 'create', + action = 'delete', entities = [ '' ], diff --git a/test/test_bulk_delete_action_pool_body.py b/test/test_bulk_delete_action_pool_body.py index a08ab703..8097175c 100644 --- a/test/test_bulk_delete_action_pool_body.py +++ b/test/test_bulk_delete_action_pool_body.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> BulkDeleteActionPoolBody: model = BulkDeleteActionPoolBody() if include_optional: return BulkDeleteActionPoolBody( - action = 'create', + action = 'delete', action_on_non_existence = 'fail', entities = [ '' @@ -43,7 +43,7 @@ def make_instance(self, include_optional) -> BulkDeleteActionPoolBody: ) else: return BulkDeleteActionPoolBody( - action = 'create', + action = 'delete', entities = [ '' ], diff --git a/test/test_bulk_delete_action_variable_body.py b/test/test_bulk_delete_action_variable_body.py index ab54707e..152618f7 100644 --- a/test/test_bulk_delete_action_variable_body.py +++ b/test/test_bulk_delete_action_variable_body.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> BulkDeleteActionVariableBody: model = BulkDeleteActionVariableBody() if include_optional: return BulkDeleteActionVariableBody( - action = 'create', + action = 'delete', action_on_non_existence = 'fail', entities = [ '' @@ -43,7 +43,7 @@ def make_instance(self, include_optional) -> BulkDeleteActionVariableBody: ) else: return BulkDeleteActionVariableBody( - action = 'create', + action = 'delete', entities = [ '' ], diff --git a/test/test_bulk_update_action_connection_body.py b/test/test_bulk_update_action_connection_body.py index 747f280e..21346a91 100644 --- a/test/test_bulk_update_action_connection_body.py +++ b/test/test_bulk_update_action_connection_body.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> BulkUpdateActionConnectionBody: model = BulkUpdateActionConnectionBody() if include_optional: return BulkUpdateActionConnectionBody( - action = 'create', + action = 'update', action_on_non_existence = 'fail', entities = [ airflow_client.client.models.connection_body.ConnectionBody( @@ -52,7 +52,7 @@ def make_instance(self, include_optional) -> BulkUpdateActionConnectionBody: ) else: return BulkUpdateActionConnectionBody( - action = 'create', + action = 'update', entities = [ airflow_client.client.models.connection_body.ConnectionBody( conn_type = '', diff --git a/test/test_bulk_update_action_pool_body.py b/test/test_bulk_update_action_pool_body.py index 8ede095f..35e9dc51 100644 --- a/test/test_bulk_update_action_pool_body.py +++ b/test/test_bulk_update_action_pool_body.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> BulkUpdateActionPoolBody: model = BulkUpdateActionPoolBody() if include_optional: return BulkUpdateActionPoolBody( - action = 'create', + action = 'update', action_on_non_existence = 'fail', entities = [ airflow_client.client.models.pool_body.PoolBody( @@ -47,7 +47,7 @@ def make_instance(self, include_optional) -> BulkUpdateActionPoolBody: ) else: return BulkUpdateActionPoolBody( - action = 'create', + action = 'update', entities = [ airflow_client.client.models.pool_body.PoolBody( description = '', diff --git a/test/test_bulk_update_action_variable_body.py b/test/test_bulk_update_action_variable_body.py index 510ba159..b0a82453 100644 --- a/test/test_bulk_update_action_variable_body.py +++ b/test/test_bulk_update_action_variable_body.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> BulkUpdateActionVariableBody: model = BulkUpdateActionVariableBody() if include_optional: return BulkUpdateActionVariableBody( - action = 'create', + action = 'update', action_on_non_existence = 'fail', entities = [ airflow_client.client.models.variable_body.VariableBody( @@ -46,7 +46,7 @@ def make_instance(self, include_optional) -> BulkUpdateActionVariableBody: ) else: return BulkUpdateActionVariableBody( - action = 'create', + action = 'update', entities = [ airflow_client.client.models.variable_body.VariableBody( description = '', diff --git a/test/test_dag_run_collection_response.py b/test/test_dag_run_collection_response.py index ff78f7c7..13556720 100644 --- a/test/test_dag_run_collection_response.py +++ b/test/test_dag_run_collection_response.py @@ -38,7 +38,7 @@ def make_instance(self, include_optional) -> DAGRunCollectionResponse: dag_runs = [ airflow_client.client.models.dag_run_response.DAGRunResponse( bundle_version = '', - conf = airflow_client.client.models.conf.Conf(), + conf = airflow_client.client.models.extra.extra(), dag_id = '', dag_run_id = '', dag_versions = [ @@ -71,7 +71,7 @@ def make_instance(self, include_optional) -> DAGRunCollectionResponse: dag_runs = [ airflow_client.client.models.dag_run_response.DAGRunResponse( bundle_version = '', - conf = airflow_client.client.models.conf.Conf(), + conf = airflow_client.client.models.extra.extra(), dag_id = '', dag_run_id = '', dag_versions = [ diff --git a/test/test_dag_run_response.py b/test/test_dag_run_response.py index 38ae0450..9064ed52 100644 --- a/test/test_dag_run_response.py +++ b/test/test_dag_run_response.py @@ -36,7 +36,7 @@ def make_instance(self, include_optional) -> DAGRunResponse: if include_optional: return DAGRunResponse( bundle_version = '', - conf = airflow_client.client.models.conf.Conf(), + conf = airflow_client.client.models.extra.extra(), dag_id = '', dag_run_id = '', dag_versions = [ @@ -64,7 +64,6 @@ def make_instance(self, include_optional) -> DAGRunResponse: ) else: return DAGRunResponse( - conf = airflow_client.client.models.conf.Conf(), dag_id = '', dag_run_id = '', dag_versions = [ diff --git a/test/test_response_clear_dag_run.py b/test/test_response_clear_dag_run.py index 67132743..bb1db019 100644 --- a/test/test_response_clear_dag_run.py +++ b/test/test_response_clear_dag_run.py @@ -93,7 +93,7 @@ def make_instance(self, include_optional) -> ResponseClearDagRun: ], total_entries = 56, bundle_version = '', - conf = airflow_client.client.models.conf.Conf(), + conf = airflow_client.client.models.extra.extra(), dag_id = '', dag_run_id = '', dag_versions = [ @@ -178,7 +178,6 @@ def make_instance(self, include_optional) -> ResponseClearDagRun: unixname = '', ) ], total_entries = 56, - conf = airflow_client.client.models.conf.Conf(), dag_id = '', dag_run_id = '', dag_versions = [ diff --git a/version.txt b/version.txt index 56fea8a0..b5021469 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -3.0.0 \ No newline at end of file +3.0.2