-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate some functions in the experimental API #19931
Conversation
the_pool = pool.get_pool(name=name) | ||
the_pool = Pool.get_pool(pool_name=name) | ||
if not the_pool: | ||
raise PoolNotFound(f"Pool {name} not found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, the get_pool
experimental API raises PoolNotFound when the pool does not exist. Since I have moved it to the Pool model, I don't want it to raise hence raising not found here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at where this function is being called, I wonder if we should just get rid of this exception altogether and just return Optional
. Not sure about this.
c1bc053
to
ddf9608
Compare
airflow/api/common/delete_dag.py
Outdated
try: | ||
models_ = [mapper.class_ for mapper in models.base.Base.registry.mappers] | ||
except AttributeError: | ||
models_ = models.base.Base._decl_class_registry.values() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worthwhile to put this somewhere in airflow.utils
with a docstring explaining why it’s needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed? It was probably a work around for not having SQLA relationships defined.
(I guess we still don't have all of them defined)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we delete airflow/api/common/experimental/delete_dag.py
etc as part of this PR too?
I was of the opinion that it's a public API and want to deprecate it first and remove it in 2.3.0 but if it's not, I can remove it. Let me know if I should go-ahead |
Yes, good point. Use the same approach as I mention here #18724 (comment) |
8e10ec5
to
e1a38c6
Compare
from airflow.api.common.experimental import check_and_get_dag, check_and_get_dagrun | ||
|
||
|
||
@deprecated(reason="Use DagRun().get_state() instead", version="2.2.3") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still used in airflow/www/api/experimental/endpoints.py -- if we are deprecating it we will need to change those references too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The experimental API is also deprecated: See
airflow/airflow/www/api/experimental/endpoints.py
Lines 56 to 60 in b20e6d3
def add_deprecation_headers(response: Response): | |
""" | |
Add `Deprecation HTTP Header Field | |
<https://tools.ietf.org/id/draft-dalal-deprecation-header-03.html>`__. | |
""" |
My thinking is that if someone is using it externally which may be possible, then we should warn
f717aaf
to
e03d24b
Compare
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
e03d24b
to
c379711
Compare
This PR seeks to deprecate some functions in the experimental API. Some of the deprecated functions are only used in the experimental REST API, others that are valid are being moved out of the experimental package.
Co-authored-by: Ash Berlin-Taylor <[email protected]>
1931cd9
to
0cda3ab
Compare
This PR seeks to deprecate some functions in the experimental API. Some of the deprecated functions are only used in the experimental REST API, others that are valid are being moved out of the experimental package. (cherry picked from commit 6239ae9)
This PR seeks to deprecate some functions in the experimental API. Some of the deprecated functions are only used in the experimental REST API, others that are valid are being moved out of the experimental package. (cherry picked from commit 6239ae9)
This PR seeks to deprecate some functions in the experimental API. Some of the deprecated functions are only used in the experimental REST API, others that are valid are being moved out of the experimental package. (cherry picked from commit 6239ae9)
This PR seeks to deprecate some functions in the experimental API.
Some of the deprecated functions are only used in the experimental REST API,
others that are valid are being moved out of the experimental package.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.