This is an automated email from the ASF dual-hosted git repository.
madhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new d6cec1683 ATLAS-4927: Fix failure in Python API
EntityClient.get_classifications()
d6cec1683 is described below
commit d6cec1683568176434d57d1f2b2fbfb487b827e4
Author: Madhan Neethiraj <[email protected]>
AuthorDate: Thu Nov 21 22:34:11 2024 -0800
ATLAS-4927: Fix failure in Python API EntityClient.get_classifications()
---
atlas-examples/sample-app/src/main/python/entity_example.py | 5 +++++
intg/src/main/python/apache_atlas/model/instance.py | 2 +-
intg/src/main/python/apache_atlas/utils.py | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/atlas-examples/sample-app/src/main/python/entity_example.py
b/atlas-examples/sample-app/src/main/python/entity_example.py
index cb2d98d4d..270e5df82 100644
--- a/atlas-examples/sample-app/src/main/python/entity_example.py
+++ b/atlas-examples/sample-app/src/main/python/entity_example.py
@@ -66,6 +66,11 @@ class EntityExample:
LOG.info("Entity(guid=%s): typeName=%s, attr.name=%s", guid,
entity.entity.typeName, entity.entity.attributes['name'])
+ def get_entity_classifications_by_guid(self, guid):
+ classifications = self.client.entity.get_classifications(guid)
+
+ LOG.info("Entity(guid=%s): classifications=%s", guid, classifications)
+
def remove_entities(self):
entity_list = [ self.entity_process.guid, self.entity_table_us.guid,
self.entity_table_canada.guid, self.entity_db.guid ]
diff --git a/intg/src/main/python/apache_atlas/model/instance.py
b/intg/src/main/python/apache_atlas/model/instance.py
index 40ee1c422..72780ee4f 100644
--- a/intg/src/main/python/apache_atlas/model/instance.py
+++ b/intg/src/main/python/apache_atlas/model/instance.py
@@ -233,7 +233,7 @@ class AtlasClassifications(Plist):
def type_coerce_attrs(self):
super(AtlasClassifications, self).type_coerce_attrs()
- Plist.list = type_coerce_list(Plist.list, AtlasClassification)
+ self.list = type_coerce_list(self.list, AtlasClassification)
class AtlasEntityHeaders(AtlasBase):
diff --git a/intg/src/main/python/apache_atlas/utils.py
b/intg/src/main/python/apache_atlas/utils.py
index c7d3d52b5..b85401212 100644
--- a/intg/src/main/python/apache_atlas/utils.py
+++ b/intg/src/main/python/apache_atlas/utils.py
@@ -54,7 +54,7 @@ def attributes_to_params(attributes, query_params=None):
query_params = {}
if attributes:
- for key, value in attributes:
+ for key, value in attributes.items():
new_key = PREFIX_ATTR + key
query_params[new_key] = value