uranusjr commented on a change in pull request #18934: URL: https://github.com/apache/airflow/pull/18934#discussion_r732708130
########## File path: airflow/api_connexion/endpoints/base.py ########## @@ -0,0 +1,242 @@ +# 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. + +from typing import Any, Container, Dict, Generic, Iterable, List, Optional, Tuple, Type, TypeVar + +from flask import request +from marshmallow import Schema, ValidationError +from sqlalchemy.orm import Query +from sqlalchemy.sql import ColumnElement + +from airflow import settings +from airflow._vendor.connexion import NoContent +from airflow.api_connexion.exceptions import AlreadyExists, BadRequest, NotFound +from airflow.api_connexion.parameters import check_limit, format_parameters +from airflow.compat.functools import cached_property +from airflow.models.base import Base + +M = TypeVar("M", bound=Base) + + +class Endpoints(Generic[M]): + """Base endpoint implementation generator class for an abstract resource. + + This class does not assume the data storage backend, and a resource must + implement various methods to make things work. If the resource is a + SQLAlchemy model, see ``ModelEndpoints``. + """ + + resource_name: str # Name of the resource for display in error messages etc. + instance_index: List[str] # List keys to uniquely select an instance. + + # A list of two-tuples mapping a field's internal name to external (as seen by the user). Review comment: Right, I changed the implementation but forgot to update the 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
