Skip to content

Commit

Permalink
[AIRFLOW-4207] Metaclass class argument for Python 3 (apache#5024)
Browse files Browse the repository at this point in the history
  • Loading branch information
BasPH authored and potiuk committed May 5, 2019
1 parent 7f4d092 commit 3185eab
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
import six


class KubernetesRequestFactory:
class KubernetesRequestFactory(metaclass=ABCMeta):
"""
Create requests to be sent to kube API.
Extend this class to talk to kubernetes and generate your specific resources.
This is equivalent of generating yaml files that can be used by `kubectl`
"""
__metaclass__ = ABCMeta

@abstractmethod
def create(self, pod):
Expand Down
3 changes: 1 addition & 2 deletions airflow/dag/base_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
from abc import ABCMeta, abstractmethod


class BaseDag():
class BaseDag(metaclass=ABCMeta):
"""
Base DAG object that both the SimpleDag and DAG inherit.
"""
__metaclass__ = ABCMeta

@property
@abstractmethod
Expand Down
4 changes: 1 addition & 3 deletions airflow/models/baseoperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,13 +979,11 @@ def get_extra_links(self, dttm, link_name):
return self.global_operator_extra_link_dict[link_name].get_link(self, dttm)


class BaseOperatorLink:
class BaseOperatorLink(metaclass=ABCMeta):
"""
Abstract base class that defines how we get an operator link.
"""

__metaclass__ = ABCMeta

@property
@abstractmethod
def name(self):
Expand Down
3 changes: 1 addition & 2 deletions airflow/utils/dag_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,10 @@ def list_py_file_paths(directory, safe_mode=True,
return file_paths


class AbstractDagFileProcessor(object):
class AbstractDagFileProcessor(metaclass=ABCMeta):
"""
Processes a DAG file. See SchedulerJob.process_file() for more details.
"""
__metaclass__ = ABCMeta

@abstractmethod
def start(self):
Expand Down

0 comments on commit 3185eab

Please sign in to comment.