Skip to content

Commit 596ead4

Browse files
vaibhavatlanAryamanz29
authored andcommitted
Added optional param which is source_tag_qualified_name in tagged_with_value()
1 parent d39f2cc commit 596ead4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pyatlan/model/fluent_search.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ def tagged(
151151

152152
@staticmethod
153153
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,
155158
) -> Query:
156159
"""
157160
Returns a query that will match assets that have a
@@ -160,6 +163,7 @@ def tagged_with_value(
160163
:param atlan_tag_name: human-readable name of the Atlan tag
161164
:param value: tag should have to match the query
162165
: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)
163167
value directly assigned (otherwise even propagated tags with the value will suffice)
164168
165169
:raises: AtlanError on any error communicating
@@ -182,17 +186,20 @@ def tagged_with_value(
182186
.execute(client=client)
183187
)
184188
]
185-
if len(synced_tags) > 1:
189+
if len(synced_tags) > 1 and source_tag_qualified_name is None:
186190
synced_tag_qn = synced_tags[0].qualified_name or ""
187191
LOGGER.warning(
188192
(
189193
"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",
190195
),
191196
atlan_tag_name,
192197
synced_tag_qn,
193198
)
194199
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+
)
196203
else:
197204
synced_tag_qn = "NON_EXISTENT"
198205

0 commit comments

Comments
 (0)