Skip to content

Commit

Permalink
Merge branch 'main' into bump-release-2.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Aryamanz29 authored May 8, 2024
2 parents 2c77c0b + ba21c20 commit b66fe01
Show file tree
Hide file tree
Showing 11 changed files with 934 additions and 153 deletions.
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ sphinx~=7.2.6
furo~=2024.1.29
requests>=2.24
pydantic~=2.6.1
jinja2==3.1.3
jinja2==3.1.4
networkx==3.1
tenacity==8.2.3
12 changes: 10 additions & 2 deletions pyatlan/client/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,10 @@ def find_term_by_name(
# the issue below is fixed or when we switch to pydantic v2
# https://github.com/pydantic/pydantic/issues/2901
def get_hierarchy(
self, glossary: AtlasGlossary, attributes: Optional[List[AtlanField]] = None
self,
glossary: AtlasGlossary,
attributes: Optional[List[AtlanField]] = None,
related_attributes: Optional[List[AtlanField]] = None,
) -> CategoryHierarchy:
"""
Retrieve category hierarchy in this Glossary, in a traversable form. You can traverse in either depth_first
Expand All @@ -1546,6 +1549,7 @@ def get_hierarchy(
:param glossary: the glossary to retrieve the category hierarchy for
:param attributes: attributes to retrieve for each category in the hierarchy
:param related_attributes: attributes to retrieve for each related asset in the hierarchy
:returns: a traversable category hierarchy
"""
from pyatlan.model.fluent_search import FluentSearch
Expand All @@ -1554,6 +1558,8 @@ def get_hierarchy(
raise ErrorCode.GLOSSARY_MISSING_QUALIFIED_NAME.exception_with_parameters()
if attributes is None:
attributes = []
if related_attributes is None:
related_attributes = []
top_categories: Set[str] = set()
category_dict: Dict[str, AtlasGlossaryCategory] = {}
search = (
Expand All @@ -1565,7 +1571,9 @@ def get_hierarchy(
.sort(AtlasGlossaryCategory.NAME.order(SortOrder.ASCENDING))
)
for field in attributes:
search.include_on_results(field)
search = search.include_on_results(field)
for field in related_attributes:
search = search.include_on_relations(field)
request = search.to_request()
response = self.search(request)
for category in filter(
Expand Down
29 changes: 27 additions & 2 deletions pyatlan/client/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,34 @@
WORKFLOW_RUN = API(
WORKFLOW_RUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES
)
WORKFLOW_UPDATE_API = "workflows"
WORKFLOW_API = "workflows"
WORKFLOW_UPDATE = API(
WORKFLOW_UPDATE_API + "/{workflow_name}",
WORKFLOW_API + "/{workflow_name}",
HTTPMethod.POST,
HTTPStatus.OK,
endpoint=EndPoint.HERACLES,
)
WORKFLOW_ARCHIVE = API(
WORKFLOW_API + "/{workflow_name}/archive",
HTTPMethod.POST,
HTTPStatus.OK,
endpoint=EndPoint.HERACLES,
)
WORKFLOW_SCHEDULE_RUN = "runs"
GET_ALL_SCHEDULE_RUNS = API(
WORKFLOW_SCHEDULE_RUN + "/cron",
HTTPMethod.GET,
HTTPStatus.OK,
endpoint=EndPoint.HERACLES,
)
GET_SCHEDULE_RUN = API(
WORKFLOW_SCHEDULE_RUN + "/cron/{workflow_name}",
HTTPMethod.GET,
HTTPStatus.OK,
endpoint=EndPoint.HERACLES,
)
STOP_WORKFLOW_RUN = API(
WORKFLOW_SCHEDULE_RUN + "/{workflow_run_id}/stop",
HTTPMethod.POST,
HTTPStatus.OK,
endpoint=EndPoint.HERACLES,
Expand Down
Loading

0 comments on commit b66fe01

Please sign in to comment.