-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
POC: How we can deprecate things in Airflow
- Loading branch information
1 parent
9563dc5
commit 65f3f55
Showing
62 changed files
with
930 additions
and
918 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# | ||
# 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. | ||
# Note: Any AirflowException raised is expected to cause the TaskInstance | ||
# to be marked in an ERROR state | ||
"""Airflow deprecation utilities.""" | ||
from __future__ import annotations | ||
|
||
from deprecated import deprecated as _deprecated | ||
|
||
|
||
class RemovedInAirflow3Warning(DeprecationWarning): | ||
"""Issued for usage of deprecated features that will be removed in Airflow3.""" | ||
|
||
deprecated_since: str | None = None | ||
"Indicates the airflow version that started raising this deprecation warning" | ||
|
||
|
||
class AirflowProviderDeprecationWarning(DeprecationWarning): | ||
"""Issued for usage of deprecated features of Airflow provider.""" | ||
|
||
deprecated_provider_since: str | None = None | ||
"Indicates the provider version that started raising this deprecation warning" | ||
|
||
|
||
# TODO This can be rewritten to include some custom arguments and / or custom message formatting. | ||
deprecated = _deprecated | ||
|
||
|
||
# Inspired by | ||
# https://github.com/tensorflow/tensorflow/blob/dec8e0b11f4f87693b67e125e67dfbc68d26c205/tensorflow/python/util/deprecation.py#L336 | ||
def deprecated_args(*args, **kwargs): | ||
"""Decorator for marking specific function arguments as deprecated. | ||
This decorator logs a deprecation warning whenever the decorated function is | ||
called with the deprecated argument. | ||
""" | ||
pass | ||
|
||
|
||
# Inspired by | ||
# https://github.com/tensorflow/tensorflow/blob/dec8e0b11f4f87693b67e125e67dfbc68d26c205/tensorflow/python/util/deprecation.py#L516 | ||
def deprecated_arg_values(func): | ||
"""Decorator for marking specific function argument values as deprecated. | ||
This decorator logs a deprecation warning whenever the decorated function is | ||
called with the deprecated argument values. | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.