Skip to content

Commit 9ca12bc

Browse files
fix: deprecate tag logic on Association (#2552)
Co-authored-by: Shreya Pandit <[email protected]>
1 parent 8130f46 commit 9ca12bc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/sagemaker/lineage/association.py

+11
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@
1515

1616
from typing import Optional, Iterator
1717
from datetime import datetime
18+
import logging
1819

1920
from sagemaker.apiutils import _base_types
2021
from sagemaker.lineage import _api_types
2122
from sagemaker.lineage._api_types import AssociationSummary
2223

24+
logger = logging.getLogger(__name__)
25+
2326

2427
class Association(_base_types.Record):
2528
"""An Amazon SageMaker artifact, which is part of a SageMaker lineage.
@@ -73,6 +76,10 @@ def set_tag(self, tag=None):
7376
Returns:
7477
list({str:str}): a list of key value pairs
7578
"""
79+
logger.warning(
80+
"set_tag on Association is deprecated. Use set_tag on the source or destination\
81+
entity instead."
82+
)
7683
return self._set_tags(resource_arn=self.source_arn, tags=[tag])
7784

7885
def set_tags(self, tags=None):
@@ -84,6 +91,10 @@ def set_tags(self, tags=None):
8491
Returns:
8592
list({str:str}): a list of key value pairs
8693
"""
94+
logger.warning(
95+
"set_tags on Association is deprecated. Use set_tags on the source or destination\
96+
entity instead."
97+
)
8798
return self._set_tags(resource_arn=self.source_arn, tags=tags)
8899

89100
@classmethod

0 commit comments

Comments
 (0)