feluelle commented on a change in pull request #6596: [AIRFLOW-6004] Untangle Executors class to avoid cyclic imports. Depends on [AIRFLOW-6010] URL: https://github.com/apache/airflow/pull/6596#discussion_r350250926
########## File path: airflow/executors/executor_types.py ########## @@ -0,0 +1,147 @@ +# 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. + +"""Aliases for common types used in executors.""" +from datetime import datetime +from queue import Queue +from typing import Any, List, Optional, Tuple, Union + +# Key used to identify task instance +# Tuple of: task_id, ?, execution_date, +from sqlalchemy import Column + +import airflow.models +from airflow.models import TaskInstance +from airflow.utils.db import provide_session + +TaskInstanceKey = Tuple[str, str, datetime, int] + +# State of the task instance. +# Stores string version of the task state. +TaskInstanceState = Tuple[TaskInstanceKey, str] + +# Command to execute - might be either string or list of strings +# with the same semantics as subprocess.Popen +CommandType = Union[str, List[str]] + + +# Task that is queued. It contains all the information that is +# needed to run the task. +# +# Tuple of: command, priority, Queue, SimpleTaskInstance +class SimpleTaskInstance: + """ + Simplified Task Instance. + + Used to send data between processes via Queues. + Review comment: empty line can be removed ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
