from __future__ import absolute_import

import warnings

from .decorators import apply_defaults as _apply_defaults


def apply_defaults(func):
    warnings.warn_explicit(
        """
        You are importing apply_defaults from airflow.utils which
        will be deprecated in a future version.
        Please use :

        from airflow.utils.decorators import apply_defaults
        """,
        category=PendingDeprecationWarning,
        filename=func.func_code.co_filename,
        lineno=func.func_code.co_firstlineno + 1
    )
    return _apply_defaults(func)

from __future__ import absolute_import

import warnings

from .decorators import apply_defaults as _apply_defaults


def apply_defaults(func):
    warnings.warn_explicit(
        """
        You are importing apply_defaults from airflow.utils which
        will be deprecated in a future version.
        Please use :

        from airflow.utils.decorators import apply_defaults
        """,
        category=PendingDeprecationWarning,
        filename=func.__code__.co_filename,
        lineno=func.__code__.co_firstlineno + 1
    )
    return _apply_defaults(func)

Fix airflow.utils deprecation warning code being Python 3 incompatible
Fix airflow.utils deprecation warning code being Python 3 incompatible

See https://docs.python.org/3.0/whatsnew/3.0.html#operators-and-special-methods

  from __future__ import absolute_import
  
  import warnings
  
  from .decorators import apply_defaults as _apply_defaults
  
  
  def apply_defaults(func):
      warnings.warn_explicit(
          """
          You are importing apply_defaults from airflow.utils which
          will be deprecated in a future version.
          Please use :
  
          from airflow.utils.decorators import apply_defaults
          """,
          category=PendingDeprecationWarning,
-         filename=func.func_code.co_filename,
+         filename=func.__code__.co_filename,
-         lineno=func.func_code.co_firstlineno + 1
+         lineno=func.__code__.co_firstlineno + 1
      )
      return _apply_defaults(func)
  
Fix airflow.utils deprecation warning code being Python 3 incompatible
## Code Before:
from __future__ import absolute_import

import warnings

from .decorators import apply_defaults as _apply_defaults


def apply_defaults(func):
    warnings.warn_explicit(
        """
        You are importing apply_defaults from airflow.utils which
        will be deprecated in a future version.
        Please use :

        from airflow.utils.decorators import apply_defaults
        """,
        category=PendingDeprecationWarning,
        filename=func.func_code.co_filename,
        lineno=func.func_code.co_firstlineno + 1
    )
    return _apply_defaults(func)

## Instruction:
Fix airflow.utils deprecation warning code being Python 3 incompatible
## Code After:
from __future__ import absolute_import

import warnings

from .decorators import apply_defaults as _apply_defaults


def apply_defaults(func):
    warnings.warn_explicit(
        """
        You are importing apply_defaults from airflow.utils which
        will be deprecated in a future version.
        Please use :

        from airflow.utils.decorators import apply_defaults
        """,
        category=PendingDeprecationWarning,
        filename=func.__code__.co_filename,
        lineno=func.__code__.co_firstlineno + 1
    )
    return _apply_defaults(func)
