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 c45ab52 ATLAS-4205: fixes in Python sample-app and Python client
c45ab52 is described below
commit c45ab520f7d94b27cd59b387cf14e9651b8e6766
Author: Madhan Neethiraj <[email protected]>
AuthorDate: Mon Mar 15 09:55:35 2021 -0700
ATLAS-4205: fixes in Python sample-app and Python client
---
.../src/main/python/discovery_example.py | 4 +-
.../sample-app/src/main/python/typedef_example.py | 2 +-
intg/src/main/python/README.md | 2 +-
intg/src/main/python/apache_atlas/model/admin.py | 3 +-
.../main/python/apache_atlas/model/discovery.py | 40 +++++++++----
.../src/main/python/apache_atlas/model/glossary.py | 44 ++++++++++----
.../src/main/python/apache_atlas/model/instance.py | 69 ++++++++++++++++------
intg/src/main/python/apache_atlas/model/lineage.py | 8 ++-
intg/src/main/python/apache_atlas/model/misc.py | 12 +++-
intg/src/main/python/apache_atlas/model/profile.py | 4 +-
.../main/python/apache_atlas/model/relationship.py | 8 ++-
intg/src/main/python/apache_atlas/model/typedef.py | 52 ++++++++++++----
intg/src/main/python/setup.py | 2 +-
13 files changed, 185 insertions(+), 65 deletions(-)
diff --git a/atlas-examples/sample-app/src/main/python/discovery_example.py
b/atlas-examples/sample-app/src/main/python/discovery_example.py
index a62de3f..78f5337 100644
--- a/atlas-examples/sample-app/src/main/python/discovery_example.py
+++ b/atlas-examples/sample-app/src/main/python/discovery_example.py
@@ -57,10 +57,10 @@ class DiscoveryExample:
def basic_search(self, type_name, classification, query):
try:
- result = self.client.discovery.basic_search(type_name,
classification, query, False, 2, 0)
+ result = self.client.discovery.basic_search(type_name,
classification, query, False, None, 'ASCENDING', 2, 0)
if result:
LOG.info("Basic-search result: %s", result)
except Exception as e:
- LOG.exception("query: '%s' failed in basic search", query)
\ No newline at end of file
+ LOG.exception("query: '%s' failed in basic search", query)
diff --git a/atlas-examples/sample-app/src/main/python/typedef_example.py
b/atlas-examples/sample-app/src/main/python/typedef_example.py
index aa1f94e..1aab7f1 100644
--- a/atlas-examples/sample-app/src/main/python/typedef_example.py
+++ b/atlas-examples/sample-app/src/main/python/typedef_example.py
@@ -22,7 +22,7 @@ import logging
import utils
from apache_atlas.utils import type_coerce
-from apache_atlas.model.discovery import SearchFilter
+from apache_atlas.model.misc import SearchFilter
from apache_atlas.model.typedef import AtlasTypesDef
diff --git a/intg/src/main/python/README.md b/intg/src/main/python/README.md
index 1982ca8..e38e28b 100644
--- a/intg/src/main/python/README.md
+++ b/intg/src/main/python/README.md
@@ -16,7 +16,7 @@ Verify if apache-atlas client is installed:
Package Version
------------ ---------
-apache-atlas 0.0.6
+apache-atlas 0.0.11
```
## Usage
diff --git a/intg/src/main/python/apache_atlas/model/admin.py
b/intg/src/main/python/apache_atlas/model/admin.py
index e826f94..72bf23b 100644
--- a/intg/src/main/python/apache_atlas/model/admin.py
+++ b/intg/src/main/python/apache_atlas/model/admin.py
@@ -20,9 +20,10 @@ from apache_atlas.model.misc import AtlasBase
class AtlasAdminMetrics(AtlasBase):
def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
- attrs = attrs or {}
_data = attrs.get('data', {})
self.general = _data.get('general', {})
diff --git a/intg/src/main/python/apache_atlas/model/discovery.py
b/intg/src/main/python/apache_atlas/model/discovery.py
index 2df4a39..1bfcc50 100644
--- a/intg/src/main/python/apache_atlas/model/discovery.py
+++ b/intg/src/main/python/apache_atlas/model/discovery.py
@@ -29,7 +29,9 @@ from apache_atlas.utils import type_coerce_list
class AtlasAggregationEntry(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.name = attrs.get('name')
@@ -37,7 +39,9 @@ class AtlasAggregationEntry(AtlasBase):
class AtlasQuickSearchResult(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.searchResults = attrs.get('searchResults')
@@ -51,7 +55,9 @@ class AtlasQuickSearchResult(AtlasBase):
class AtlasSearchResult(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.queryType = non_null(attrs.get('queryType'), QueryType.BASIC.name)
@@ -74,7 +80,9 @@ class AtlasSearchResult(AtlasBase):
class AttributeSearchResult(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.name = attrs.get('name')
@@ -82,7 +90,9 @@ class AttributeSearchResult(AtlasBase):
class AtlasFullTextResult(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.entity = attrs.get('entity')
@@ -95,7 +105,9 @@ class AtlasFullTextResult(AtlasBase):
class AtlasSuggestionsResult(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.suggestions = attrs.get('suggestions')
@@ -104,7 +116,9 @@ class AtlasSuggestionsResult(AtlasBase):
class QuickSearchParameters(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.query = attrs.get('query')
@@ -123,7 +137,9 @@ class QuickSearchParameters(AtlasBase):
class SearchParameters(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.query = attrs.get('query')
@@ -150,7 +166,9 @@ class SearchParameters(AtlasBase):
class FilterCriteria(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.attributeName = attrs.get('attributeName')
@@ -166,7 +184,9 @@ class FilterCriteria(AtlasBase):
class AtlasUserSavedSearch(AtlasBaseModelObject):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBaseModelObject.__init__(self, attrs)
self.ownerName = attrs.get('ownerName')
diff --git a/intg/src/main/python/apache_atlas/model/glossary.py
b/intg/src/main/python/apache_atlas/model/glossary.py
index d0ea30d..2d47747 100644
--- a/intg/src/main/python/apache_atlas/model/glossary.py
+++ b/intg/src/main/python/apache_atlas/model/glossary.py
@@ -20,7 +20,9 @@ from apache_atlas.utils import type_coerce, type_coerce_dict,
type_coerce_list
class AtlasGlossaryBaseObject(AtlasBaseModelObject):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBaseModelObject.__init__(self, attrs)
self.qualifiedName = attrs.get('qualifiedName')
@@ -33,12 +35,15 @@ class AtlasGlossaryBaseObject(AtlasBaseModelObject):
def type_coerce_attrs(self):
# This is to avoid the circular dependencies that instance.py and
glossary.py has.
import apache_atlas.model.instance as instance
+
super(AtlasGlossaryBaseObject, self).type_coerce_attrs()
self.classifications = type_coerce_list(self.classifications,
instance.AtlasClassification)
class AtlasGlossary(AtlasGlossaryBaseObject):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasGlossaryBaseObject.__init__(self, attrs)
self.language = attrs.get('language')
@@ -54,7 +59,9 @@ class AtlasGlossary(AtlasGlossaryBaseObject):
class AtlasGlossaryExtInfo(AtlasGlossary):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasGlossary.__init__(self, attrs)
self.termInfo = attrs.get('termInfo')
@@ -68,7 +75,9 @@ class AtlasGlossaryExtInfo(AtlasGlossary):
class AtlasGlossaryCategory(AtlasGlossaryBaseObject):
- def __init__(self, attrs):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasGlossaryBaseObject.__init__(self, attrs)
# Inherited attributes from relations
@@ -91,7 +100,9 @@ class AtlasGlossaryCategory(AtlasGlossaryBaseObject):
class AtlasGlossaryTerm(AtlasGlossaryBaseObject):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasGlossaryBaseObject.__init__(self, attrs)
# Core attributes
@@ -136,6 +147,9 @@ class AtlasGlossaryTerm(AtlasGlossaryBaseObject):
def type_coerce_attrs(self):
super(AtlasGlossaryTerm, self).type_coerce_attrs()
+ # This is to avoid the circular dependencies that instance.py and
glossary.py has.
+ import apache_atlas.model.instance as instance
+
self.anchor = type_coerce(self.anchor, AtlasGlossaryHeader)
self.assignedEntities = type_coerce_list(self.assignedEntities,
instance.AtlasRelatedObjectId)
self.categories = type_coerce_list(self.categories,
AtlasTermCategorizationHeader)
@@ -154,7 +168,9 @@ class AtlasGlossaryTerm(AtlasGlossaryBaseObject):
class AtlasGlossaryHeader(AtlasBase):
- def __init__(self, attrs):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.glossaryGuid = attrs.get('glossaryGuid')
@@ -163,7 +179,9 @@ class AtlasGlossaryHeader(AtlasBase):
class AtlasRelatedCategoryHeader(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.categoryGuid = attrs.get('categoryGuid')
@@ -174,7 +192,9 @@ class AtlasRelatedCategoryHeader(AtlasBase):
class AtlasRelatedTermHeader(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.termGuid = attrs.get('termGuid')
@@ -188,7 +208,9 @@ class AtlasRelatedTermHeader(AtlasBase):
class AtlasTermAssignmentHeader(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.termGuid = attrs.get('termGuid')
@@ -203,7 +225,9 @@ class AtlasTermAssignmentHeader(AtlasBase):
class AtlasTermCategorizationHeader(AtlasBase):
- def __init__(self, attrs):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.categoryGuid = attrs.get('categoryGuid')
diff --git a/intg/src/main/python/apache_atlas/model/instance.py
b/intg/src/main/python/apache_atlas/model/instance.py
index d2a51ef..40ee1c4 100644
--- a/intg/src/main/python/apache_atlas/model/instance.py
+++ b/intg/src/main/python/apache_atlas/model/instance.py
@@ -22,7 +22,9 @@ from apache_atlas.utils import non_null, type_coerce,
type_coerce_dict, type_coe
class AtlasStruct(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.typeName = attrs.get('typeName')
@@ -44,9 +46,10 @@ class AtlasStruct(AtlasBase):
class AtlasEntity(AtlasStruct):
def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasStruct.__init__(self, attrs)
- if attrs is None:
- attrs = {}
+
self.guid = attrs.get('guid')
self.homeId = attrs.get('homeId')
self.relationshipAttributes = attrs.get('relationshipAttributes')
@@ -90,7 +93,9 @@ class AtlasEntity(AtlasStruct):
class AtlasEntityExtInfo(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.referredEntities = attrs.get('referredEntities')
@@ -112,7 +117,9 @@ class AtlasEntityExtInfo(AtlasBase):
class AtlasEntityWithExtInfo(AtlasEntityExtInfo):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasEntityExtInfo.__init__(self, attrs)
self.entity = attrs.get('entity')
@@ -124,7 +131,9 @@ class AtlasEntityWithExtInfo(AtlasEntityExtInfo):
class AtlasEntitiesWithExtInfo(AtlasEntityExtInfo):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasEntityExtInfo.__init__(self, attrs)
self.entities = attrs.get('entities')
@@ -142,7 +151,9 @@ class AtlasEntitiesWithExtInfo(AtlasEntityExtInfo):
class AtlasEntityHeader(AtlasStruct):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasStruct.__init__(self, attrs)
self.guid = attrs.get('guid')
@@ -166,7 +177,9 @@ class AtlasEntityHeader(AtlasStruct):
class AtlasClassification(AtlasStruct):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasStruct.__init__(self, attrs)
self.entityGuid = attrs.get('entityGuid')
@@ -182,7 +195,9 @@ class AtlasClassification(AtlasStruct):
class AtlasObjectId(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.guid = attrs.get('guid')
@@ -191,7 +206,9 @@ class AtlasObjectId(AtlasBase):
class AtlasRelatedObjectId(AtlasObjectId):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasObjectId.__init__(self, attrs)
self.entityStatus = attrs.get('entityStatus')
@@ -208,7 +225,9 @@ class AtlasRelatedObjectId(AtlasObjectId):
class AtlasClassifications(Plist):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
Plist.__init__(self, attrs)
def type_coerce_attrs(self):
@@ -218,7 +237,9 @@ class AtlasClassifications(Plist):
class AtlasEntityHeaders(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.guidHeaderMap = attrs.get('guidHeaderMap')
@@ -230,7 +251,9 @@ class AtlasEntityHeaders(AtlasBase):
class EntityMutationResponse(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.mutatedEntities = attrs.get('mutatedEntities')
@@ -246,7 +269,9 @@ class EntityMutationResponse(AtlasBase):
class EntityMutations(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.entity_mutations = attrs.get('entity_mutations')
@@ -258,7 +283,9 @@ class EntityMutations(AtlasBase):
class EntityMutation(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.op = attrs.get('op')
@@ -271,7 +298,9 @@ class EntityMutation(AtlasBase):
class AtlasCheckStateRequest(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.entityGuids = attrs.get('entityGuids')
@@ -280,7 +309,9 @@ class AtlasCheckStateRequest(AtlasBase):
class AtlasCheckStateResult(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.entitiesScanned = attrs.get('entitiesScanned')
@@ -298,7 +329,9 @@ class AtlasCheckStateResult(AtlasBase):
class AtlasEntityState(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.guid = attrs.get('guid')
diff --git a/intg/src/main/python/apache_atlas/model/lineage.py
b/intg/src/main/python/apache_atlas/model/lineage.py
index 180989d..ec85695 100644
--- a/intg/src/main/python/apache_atlas/model/lineage.py
+++ b/intg/src/main/python/apache_atlas/model/lineage.py
@@ -22,7 +22,9 @@ from apache_atlas.utils import type_coerce_list
class AtlasLineageInfo(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.baseEntityGuid = attrs.get('baseEntityGuid')
@@ -39,7 +41,9 @@ class AtlasLineageInfo(AtlasBase):
class LineageRelation(AtlasBase):
- def __init__(self, attrs):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.fromEntityId = attrs.get('fromEntityId')
diff --git a/intg/src/main/python/apache_atlas/model/misc.py
b/intg/src/main/python/apache_atlas/model/misc.py
index f4d9c1c..030d0d1 100644
--- a/intg/src/main/python/apache_atlas/model/misc.py
+++ b/intg/src/main/python/apache_atlas/model/misc.py
@@ -61,7 +61,9 @@ class AtlasBaseModelObject(AtlasBase):
class TimeBoundary(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.startTime = attrs.get('startTime')
@@ -70,7 +72,9 @@ class TimeBoundary(AtlasBase):
class Plist(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.list = non_null(attrs.get('list'), [])
@@ -82,7 +86,9 @@ class Plist(AtlasBase):
class SearchFilter(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.startIndex = non_null(attrs.get('startIndex'), 0)
diff --git a/intg/src/main/python/apache_atlas/model/profile.py
b/intg/src/main/python/apache_atlas/model/profile.py
index 7ef2bf1..f362116 100644
--- a/intg/src/main/python/apache_atlas/model/profile.py
+++ b/intg/src/main/python/apache_atlas/model/profile.py
@@ -21,7 +21,9 @@ from apache_atlas.utils import type_coerce
class AtlasUserSavedSearch(AtlasBaseModelObject):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBaseModelObject.__init__(self, attrs)
self.ownerName = attrs.get('ownerName')
diff --git a/intg/src/main/python/apache_atlas/model/relationship.py
b/intg/src/main/python/apache_atlas/model/relationship.py
index 2a32811..d6036db 100644
--- a/intg/src/main/python/apache_atlas/model/relationship.py
+++ b/intg/src/main/python/apache_atlas/model/relationship.py
@@ -26,7 +26,9 @@ from apache_atlas.utils import type_coerce_list
class AtlasRelationship(AtlasStruct):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasStruct.__init__(self, attrs)
self.guid = attrs.get('guid')
@@ -56,7 +58,9 @@ class AtlasRelationship(AtlasStruct):
class AtlasRelationshipWithExtInfo(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.relationship = attrs.get('relationship')
diff --git a/intg/src/main/python/apache_atlas/model/typedef.py
b/intg/src/main/python/apache_atlas/model/typedef.py
index 079f714..c4c3c91 100644
--- a/intg/src/main/python/apache_atlas/model/typedef.py
+++ b/intg/src/main/python/apache_atlas/model/typedef.py
@@ -28,7 +28,9 @@ LOG = logging.getLogger('apache_atlas')
class AtlasBaseTypeDef(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.category = attrs.get('category')
@@ -46,7 +48,9 @@ class AtlasBaseTypeDef(AtlasBase):
class AtlasEnumDef(AtlasBaseTypeDef):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBaseTypeDef.__init__(self, attrs)
self.elementDefs = attrs.get('elementDefs')
@@ -59,7 +63,9 @@ class AtlasEnumDef(AtlasBaseTypeDef):
class AtlasStructDef(AtlasBaseTypeDef):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBaseTypeDef.__init__(self, attrs)
self.category = non_null(attrs.get('category'),
TypeCategory.STRUCT.name)
@@ -72,7 +78,9 @@ class AtlasStructDef(AtlasBaseTypeDef):
class AtlasClassificationDef(AtlasStructDef):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasStructDef.__init__(self, attrs)
self.category = TypeCategory.CLASSIFICATION.name
@@ -82,7 +90,9 @@ class AtlasClassificationDef(AtlasStructDef):
class AtlasEntityDef(AtlasStructDef):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasStructDef.__init__(self, attrs)
self.category = TypeCategory.ENTITY.name
@@ -99,7 +109,9 @@ class AtlasEntityDef(AtlasStructDef):
class AtlasRelationshipDef(AtlasStructDef):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasStructDef.__init__(self, attrs)
self.category = TypeCategory.RELATIONSHIP.name
@@ -117,14 +129,18 @@ class AtlasRelationshipDef(AtlasStructDef):
class AtlasBusinessMetadataDef(AtlasStructDef):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasStructDef.__init__(self, attrs)
self.category = TypeCategory.BUSINESS_METADATA.name
class AtlasAttributeDef(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.name = attrs.get('name')
@@ -151,7 +167,9 @@ class AtlasAttributeDef(AtlasBase):
class AtlasConstraintDef(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.type = attrs.get('type')
@@ -159,7 +177,9 @@ class AtlasConstraintDef(AtlasBase):
class AtlasEnumElementDef(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.value = attrs.get('value')
@@ -168,7 +188,9 @@ class AtlasEnumElementDef(AtlasBase):
class AtlasRelationshipAttributeDef(AtlasAttributeDef):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasAttributeDef.__init__(self, attrs)
self.relationshipTypeName = attrs.get('relationshipTypeName')
@@ -176,7 +198,9 @@ class AtlasRelationshipAttributeDef(AtlasAttributeDef):
class AtlasRelationshipEndDef(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.type = attrs.get('type')
@@ -188,7 +212,9 @@ class AtlasRelationshipEndDef(AtlasBase):
class AtlasTypesDef(AtlasBase):
- def __init__(self, attrs={}):
+ def __init__(self, attrs=None):
+ attrs = attrs or {}
+
AtlasBase.__init__(self, attrs)
self.enumDefs = attrs.get('enumDefs')
diff --git a/intg/src/main/python/setup.py b/intg/src/main/python/setup.py
index fbb2ede..35d79fe 100644
--- a/intg/src/main/python/setup.py
+++ b/intg/src/main/python/setup.py
@@ -28,7 +28,7 @@ with open("README.md", "r") as fh:
setup(
name='apache-atlas',
- version='0.0.6',
+ version='0.0.11',
author="Apache Atlas",
author_email='[email protected]',
description="Apache Atlas Python Client",