Skip to content

Commit 9bac970

Browse files
committed
minor changes and updates - including to guids.
Signed-off-by: Dan Wolfson <[email protected]>
1 parent e089df5 commit 9bac970

File tree

6 files changed

+44
-37
lines changed

6 files changed

+44
-37
lines changed

examples/widgets/catalog_user/view_asset_graph.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ def build_classifications(classification: dict) -> Markdown:
4747
c_type = c["classificationName"]
4848
if c_type == "Anchors":
4949
continue
50-
class_md += f"* Classification: {c_type}\n"
50+
class_md += f"\n* Classification: {c_type}\n"
5151
class_props = c.get("classificationProperties","---")
52-
if type(class_props) is list:
52+
if type(class_props) is dict:
5353
for prop in class_props.keys():
5454
class_md += f"\t* {prop}: {class_props[prop]}\n"
5555
if class_md == "":
@@ -70,14 +70,15 @@ def build_nested_elements(nested_element: dict) -> Markdown:
7070
ne_classifications = nested_element["classifications"]
7171
ne_class_md = build_classifications(ne_classifications)
7272
# ne_class_md = " " if ne_class_md is None else ne_class_md
73-
ne_props = nested_element["properties"]
74-
75-
ne_prop_md = ""
76-
for prop in ne_props.keys():
77-
ne_prop_md += f"* {prop}: {ne_props[prop]}\n"
73+
ne_props = nested_element.get("properties","---")
74+
ne_prop_md = "\n"
75+
if type(ne_props) is dict:
76+
for prop in ne_props.keys():
77+
ne_prop_md += f"\t* {prop}: {ne_props[prop]}\n"
7878
ne_md = (f"Nested Element of Type: {ne_type} with GUID: {ne_guid} \n "
7979
f"* created by {ne_created_by} at time {ne_created_at}\n"
80-
f"{ne_prop_md}\n")
80+
f"\n* Properties:\n{ne_prop_md}\n")
81+
8182
if ne_class_md is not None:
8283
ne_md += f"* {ne_class_md}"
8384

@@ -167,16 +168,16 @@ def build_nested_elements(nested_element: dict) -> Markdown:
167168
rel_end1 = relationship["end1"]
168169
rel_end1_type = rel_end1["type"]["typeName"]
169170
rel_end1_guid = rel_end1["guid"]
170-
rel_end1_unique_name = rel_end1["uniqueName"]
171+
rel_end1_unique_name = rel_end1.get("uniqueName","---")
171172

172173
rel_end2 = relationship["end2"]
173174
rel_end2_type = rel_end2["type"]["typeName"]
174175
rel_end2_guid = rel_end2["guid"]
175-
rel_end2_unique_name = rel_end2["uniqueName"]
176+
rel_end2_unique_name = rel_end2.get("uniqueName", "---")
176177

177178
if (rel_end1_guid not in guid_list) or (rel_end2_guid not in guid_list):
178-
rel_end1_class_md = build_classifications(rel_end1["classifications"])
179-
rel_end2_class_md = build_classifications(rel_end2["classifications"])
179+
# rel_end1_class_md = build_classifications(rel_end1["classifications"])
180+
# rel_end2_class_md = build_classifications(rel_end2["classifications"])
180181

181182
relationship_guid = relationship["guid"]
182183
relationship_type = relationship["type"]["typeName"]
@@ -201,8 +202,8 @@ def build_nested_elements(nested_element: dict) -> Markdown:
201202
f"\t* Unique Name: {rel_end1_unique_name}\n"
202203
)
203204

204-
if rel_end1_class_md is not None:
205-
rel_end1_md = rel_end1_class_md + rel_end1_md
205+
# if rel_end1_class_md is not None:
206+
# rel_end1_md = rel_end1_class_md + rel_end1_md
206207

207208
rel_end2_md = (
208209
f"* End2:\n"
@@ -211,8 +212,8 @@ def build_nested_elements(nested_element: dict) -> Markdown:
211212
f"\t* Unique Name: {rel_end2_unique_name}\n"
212213
)
213214

214-
if rel_end2_class_md is not None:
215-
rel_end1_md = rel_end2_class_md + rel_end1_md
215+
# if rel_end2_class_md is not None:
216+
# rel_end1_md = rel_end2_class_md + rel_end1_md
216217
#
217218
# for prop in relationship_properties.keys():
218219
# relationship_md += f"* {prop}: {relationship_properties[prop]}\n"

pyegeria/Xloaded_resources_omvs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(
5757
Client.__init__(self, server_name, platform_url,
5858
user_id, user_pwd, verify_flag)
5959

60-
def get_all_templates(self, server: str = None, start_from: int = 0, page_size: int = 0) -> list | str:
60+
def get_all_templates(self, server: str = None, start_from: int = 0, page_size: int = max_paging_size) -> list | str:
6161
""" Get Loaded templates for the Server.
6262
6363
Parameters
@@ -89,3 +89,4 @@ def get_all_templates(self, server: str = None, start_from: int = 0, page_size:
8989
return response.json().get("elementList", "No elements")
9090

9191
# def get_all_assets_in_archives(self, asset_type: str = None, archive_id: str = None, server: str= None, page_start:int = 0, page_size = max_paging_size):
92+

pyegeria/core_guids.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
KEYSTORE_FILE_TEMPLATE_GUID = 'FBCFCC0C-1652-421F-B49B-C3E1C108768F'
1515

16-
OSS_UNITY_CATALOG_FUNCTION_TEMPLATE_GUID = '4AE9F6DF-4678-4B0A-A492-4A982C8397FD'
16+
OSS_UNITY_CATALOG_FUNCTION_TEMPLATE_GUID = '5B72BD18-665D-4696-8EBB-F6D0885312E2'
1717

1818
DATA_FILE_TEMPLATE_GUID = '66D8DDA9-00CF-4E59-938C-4B0583596B1E'
1919

@@ -23,7 +23,7 @@
2323

2424
POSTGRESQL_RELATIONAL_DATABASE_TEMPLATE_GUID = '3D398B3F-7AE6-4713-952A-409F3DEA8520'
2525

26-
OSS_UNITY_CATALOG_VOLUME_TEMPLATE_GUID = '384386BA-83C0-4981-8553-4306AECE440F'
26+
OSS_UNITY_CATALOG_VOLUME_TEMPLATE_GUID = 'DFC0C928-0DB3-4EB4-A1F0-0760DAB168C5'
2727

2828
PROGRAM_FILE_TEMPLATE_GUID = '32D27E9C-1FDF-455A-AD2A-42B4D7D99108'
2929

@@ -55,7 +55,7 @@
5555

5656
APACHE_KAFKA_SERVER_TEMPLATE_GUID = '5E1FF810-5418-43F7-B7C4-E6E062F9AFF7'
5757

58-
OSS_UNITY_CATALOG_SCHEMA_TEMPLATE_GUID = 'A75CFB07-31FE-457E-9298-BE145DC93071'
58+
OSS_UNITY_CATALOG_SCHEMA_TEMPLATE_GUID = 'D68F5AA3-152E-40FA-8C16-E73DB8D925D6'
5959

6060
EXECUTABLE_FILE_TEMPLATE_GUID = '3D99A163-7A13-4576-A212-784010A8302A'
6161

@@ -69,6 +69,8 @@
6969

7070
APPLE_MACBOOK_PRO_TEMPLATE_GUID = '32A9FD56-85C9-47FE-A211-9DA3871BF4DA'
7171

72+
OSS_UNITY_CATALOG_TABLE_TEMPLATE_GUID = 'CB34184B-D6A9-4A27-9FD2-EA4C78978F9F'
73+
7274
BUILD_INSTRUCTION_FILE_TEMPLATE_GUID = 'FBB2FA2E-8BCB-402E-9BE7-5C6DB9F2C504'
7375

7476
SPREADSHEET_DATA_FILE_TEMPLATE_GUID = 'E4FABFF5-2BA9-4050-9076-6ED917970B4C'
@@ -83,8 +85,6 @@
8385

8486
AVRO_DATA_FILE_TEMPLATE_GUID = '9F5BE428-058E-41DD-B506-3A222283B579'
8587

86-
OSS_UNITY_CATALOG_TABLE_TEMPLATE_GUID = 'F5B12348-92AC-4A52-B8E0-B06CF215484E'
87-
8888
FILE_TEMPLATE_GUID = 'AE3067C7-CC72-4A18-88E1-746803C2C86F'
8989

9090
APACHE_KAFKA_TOPIC_TEMPLATE_GUID = 'EA8F81C9-C59C-47DE-9525-7CC59D1251E5'
@@ -103,19 +103,23 @@
103103
# Integration Connector GUIDS
104104
#
105105

106-
PostgreSQL_Relational_Database_Integration_Connector_GUID = '70dcd0b7-9f06-48ad-ad44-ae4d7a7762aa'
107106

108-
Landing_Area_File_Monitor_Integration_Connector_GUID = '1b98cdac-dd0a-4621-93db-99ef5a1098bc'
109107

110-
FileFolder_Integration_Connector_GUID = 'cd6479e1-2fe7-4426-b358-8a0cf70be117'
108+
JDBC_RELATIONAL_DATABASE_INTEGRATION_CONNECTOR_GUID = '70DCD0B7-9F06-48AD-AD44-AE4D7A7762AA'
109+
110+
POSTGRESQL_RELATIONAL_DATABASE_INTEGRATION_CONNECTOR_GUID = '70DCD0B7-9F06-48AD-AD44-AE4D7A7762AA'
111+
112+
LANDING_AREA_FILE_MONITOR_INTEGRATION_CONNECTOR_GUID = '1B98CDAC-DD0A-4621-93DB-99EF5A1098BC'
113+
114+
FILEFOLDER_INTEGRATION_CONNECTOR_GUID = 'CD6479E1-2FE7-4426-B358-8A0CF70BE117'
111115

112-
OSS_Unity_Catalog_Catalog_Integration_Connector_GUID = '74dde22f-2249-4ea3-af2b-b39e73f79b81'
116+
OSS_UNITY_CATALOG_CATALOG_INTEGRATION_CONNECTOR_GUID = '74DDE22F-2249-4EA3-AF2B-B39E73F79B81'
113117

114-
PostgreSQL_Server_Integration_Connector_GUID = '36f69fd0-54ba-4f59-8a44-11ccf2687a34'
118+
POSTGRESQL_SERVER_INTEGRATION_CONNECTOR_GUID = '36F69FD0-54BA-4F59-8A44-11CCF2687A34'
115119

116-
Apache_Kafka_Server_Integration_Connector_GUID = 'fa1f711c-0b34-4b57-8e6e-16162b132b0c'
120+
APACHE_KAFKA_SERVER_INTEGRATION_CONNECTOR_GUID = 'FA1F711C-0B34-4B57-8E6E-16162B132B0C'
117121

118-
Software_Server_Integration_Connector_GUID = 'b89d9a5a-2ea6-49bc-a4fc-e7df9f3ca93e'
122+
SOFTWARE_SERVER_INTEGRATION_CONNECTOR_GUID = 'B89D9A5A-2EA6-49BC-A4FC-E7DF9F3CA93E'
119123

120-
OSS_Unity_Catalog_Server_Integration_Connector_GUID = '06d068d9-9e08-4e67-8c59-073bbf1013af'
124+
OSS_UNITY_CATALOG_SERVER_INTEGRATION_CONNECTOR_GUID = '06D068D9-9E08-4E67-8C59-073BBF1013AF'
121125

pyegeria/server_operations.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def get_active_configuration(self, server: str = None) -> dict | str:
8686
#
8787
# Archive Files
8888
#
89-
async def _async_add_archive_file(self, archive_file: str, server: str = None) -> None:
89+
async def _async_add_archive_file(self, archive_file: str, server: str = None, timeout: int = 30) -> None:
9090
"""
9191
Load the server with the contents of the indicated archive file.
9292
@@ -95,7 +95,7 @@ async def _async_add_archive_file(self, archive_file: str, server: str = None) -
9595
archive_file: the name of the archive file to load
9696
- note that the path is relative to the working directory of the platform.
9797
server : Use the server if specified. If None, use the default server associated with the Platform object.
98-
98+
timeout: Timeout in seconds. Defaults to 30 seconds.
9999
Returns
100100
-------
101101
Response object. Also throws exceptions if no viable server or endpoint errors
@@ -110,9 +110,9 @@ async def _async_add_archive_file(self, archive_file: str, server: str = None) -
110110
+ "/instance/open-metadata-archives/file"
111111
)
112112

113-
await self._async_make_request("POST-DATA", url, archive_file)
113+
await self._async_make_request("POST-DATA", url, archive_file, time_out=timeout)
114114

115-
def add_archive_file(self, archive_file: str, server: str = None) -> None:
115+
def add_archive_file(self, archive_file: str, server: str = None, timeout:int = 30) -> None:
116116
"""
117117
Load the server with the contents of the indicated archive file.
118118
@@ -121,14 +121,15 @@ def add_archive_file(self, archive_file: str, server: str = None) -> None:
121121
archive_file: the name of the archive file to load
122122
- note that the path is relative to the working directory of the platform.
123123
server : Use the server if specified. If None, use the default server associated with the Platform object.
124+
timeout: Timeout in seconds. Defaults to 30 seconds.
124125
125126
Returns
126127
-------
127128
Response object. Also throws exceptions if no viable server or endpoint errors
128129
129130
"""
130131
loop = asyncio.get_event_loop()
131-
loop.run_until_complete(self._async_add_archive_file(archive_file, server))
132+
loop.run_until_complete(self._async_add_archive_file(archive_file, server, timeout))
132133

133134
async def _async_add_archive(self, archive_connection: str, server: str = None) -> None:
134135
""" Load the server with the contents of the indicated archive file.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pyegeria"
3-
version = "0.5.5.1"
3+
version = "0.5.5.10"
44
license = 'Apache 2.0'
55
authors = ["Dan Wolfson <[email protected]>"]
66
readme = "README.md"

tests/test_automated_curation_omvs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from rich.console import Console
2020
from rich.pretty import pprint
2121

22-
from pyegeria import AutomatedCuration, PostgreSQL_Server_Integration_Connector_GUID
22+
from pyegeria import AutomatedCuration, POSTGRESQL_SERVER_INTEGRATION_CONNECTOR_GUID
2323
from pyegeria._exceptions import (InvalidParameterException, PropertyServerException, UserNotAuthorizedException,
2424
print_exception_response, )
2525

0 commit comments

Comments
 (0)