Skip to content

Commit

Permalink
fix(providers/amazon): alias is_authorized_dataset to is_authorized_a…
Browse files Browse the repository at this point in the history
…sset (apache#43470)
  • Loading branch information
Lee-W authored Oct 29, 2024
1 parent baf2b3c commit 39dba92
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
from __future__ import annotations

import argparse
import warnings
from collections import defaultdict
from functools import cached_property
from typing import TYPE_CHECKING, Container, Sequence, cast

from flask import session, url_for

from airflow.cli.cli_config import CLICommand, DefaultHelpParser, GroupCommand
from airflow.exceptions import AirflowOptionalProviderFeatureException
from airflow.exceptions import AirflowOptionalProviderFeatureException, AirflowProviderDeprecationWarning
from airflow.providers.amazon.aws.auth_manager.avp.entities import AvpEntities
from airflow.providers.amazon.aws.auth_manager.avp.facade import (
AwsAuthManagerAmazonVerifiedPermissionsFacade,
Expand Down Expand Up @@ -166,6 +167,16 @@ def is_authorized_asset(
method=method, entity_type=AvpEntities.ASSET, user=user or self.get_user(), entity_id=asset_uri
)

def is_authorized_dataset(
self, *, method: ResourceMethod, details: AssetDetails | None = None, user: BaseUser | None = None
) -> bool:
warnings.warn(
"is_authorized_dataset will be renamed as is_authorized_asset in Airflow 3 and will be removed when the minimum Airflow version is set to 3.0 for the amazon provider",
AirflowProviderDeprecationWarning,
stacklevel=2,
)
return self.is_authorized_asset(method=method, user=user)

def is_authorized_pool(
self, *, method: ResourceMethod, details: PoolDetails | None = None, user: BaseUser | None = None
) -> bool:
Expand Down

0 comments on commit 39dba92

Please sign in to comment.