Skip to content

Commit 46e0b15

Browse files
authored
Merge pull request #655 from atlanhq/APP-7131
APP-7131: Added `active` filter to `find_by_product/domain()` methods
2 parents 0fefc5c + d39590c commit 46e0b15

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pyatlan/client/asset.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,7 +1881,11 @@ def find_domain_by_name(
18811881
:raises NotFoundError: if no domain with the provided name exists
18821882
"""
18831883
attributes = attributes or []
1884-
query = Term.with_name(name) + Term.with_type_name("DataDomain")
1884+
query = (
1885+
Term.with_state("ACTIVE")
1886+
+ Term.with_name(name)
1887+
+ Term.with_type_name("DataDomain")
1888+
)
18851889
return self._search_for_asset_with_name(
18861890
query=query, name=name, asset_type=DataDomain, attributes=attributes
18871891
)[0]
@@ -1901,7 +1905,11 @@ def find_product_by_name(
19011905
:raises NotFoundError: if no product with the provided name exists
19021906
"""
19031907
attributes = attributes or []
1904-
query = Term.with_name(name) + Term.with_type_name("DataProduct")
1908+
query = (
1909+
Term.with_state("ACTIVE")
1910+
+ Term.with_name(name)
1911+
+ Term.with_type_name("DataProduct")
1912+
)
19051913
return self._search_for_asset_with_name(
19061914
query=query, name=name, asset_type=DataProduct, attributes=attributes
19071915
)[0]

0 commit comments

Comments
 (0)