Skip to content
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

Make AwsAuthManager compatible with only Airflow >= 2.9 #40690

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion airflow/providers/amazon/aws/auth_manager/aws_auth_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ class AwsAuthManager(BaseAuthManager):
"""

def __init__(self, appbuilder: AirflowAppBuilder) -> None:
from packaging.version import Version

from airflow.version import version

if Version(version) < Version("2.9"):
raise AirflowOptionalProviderFeatureException(
"``AwsAuthManager`` is compatible with Airflow versions >= 2.9."
)

super().__init__(appbuilder)
self._check_avp_schema_version()

Expand Down Expand Up @@ -197,8 +206,14 @@ def is_authorized_view(
)

def is_authorized_custom_view(
self, *, method: ResourceMethod | str, resource_name: str, user: BaseUser | None = None
self,
*,
method: ResourceMethod | str,
resource_name: str,
user: BaseUser | None = None,
**kwargs,
):
# TODO: remove this if block when min_airflow_version is set to higher than 2.9.0
vincbeck marked this conversation as resolved.
Show resolved Hide resolved
return self.avp_facade.is_authorized(
method=method,
entity_type=AvpEntities.CUSTOM,
Expand Down
Loading