@@ -151,7 +151,10 @@ def tagged(
151
151
152
152
@staticmethod
153
153
def tagged_with_value (
154
- atlan_tag_name : str , value : str , directly : bool = False
154
+ atlan_tag_name : str ,
155
+ value : str ,
156
+ directly : bool = False ,
157
+ source_tag_qualified_name : Optional [str ] = None ,
155
158
) -> Query :
156
159
"""
157
160
Returns a query that will match assets that have a
@@ -160,6 +163,7 @@ def tagged_with_value(
160
163
:param atlan_tag_name: human-readable name of the Atlan tag
161
164
:param value: tag should have to match the query
162
165
:param directly: when `True`, the asset must have the tag and
166
+ :param source_tag_qualified_name: qualifiedName of the source tag to match (when there are multiple)
163
167
value directly assigned (otherwise even propagated tags with the value will suffice)
164
168
165
169
:raises: AtlanError on any error communicating
@@ -182,17 +186,20 @@ def tagged_with_value(
182
186
.execute (client = client )
183
187
)
184
188
]
185
- if len (synced_tags ) > 1 :
189
+ if len (synced_tags ) > 1 and source_tag_qualified_name is None :
186
190
synced_tag_qn = synced_tags [0 ].qualified_name or ""
187
191
LOGGER .warning (
188
192
(
189
193
"Multiple mapped source-synced tags found for tag %s -- using only the first: %s" ,
194
+ "You can specify the source tag qualified name so we can match to the specific one" ,
190
195
),
191
196
atlan_tag_name ,
192
197
synced_tag_qn ,
193
198
)
194
199
elif synced_tags :
195
- synced_tag_qn = synced_tags [0 ].qualified_name or ""
200
+ synced_tag_qn = (
201
+ source_tag_qualified_name or synced_tags [0 ].qualified_name or ""
202
+ )
196
203
else :
197
204
synced_tag_qn = "NON_EXISTENT"
198
205
0 commit comments