Skip to content

Commit

Permalink
using @Property
Browse files Browse the repository at this point in the history
  • Loading branch information
haoxins committed Jan 27, 2024
1 parent 76891d6 commit 46abb84
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nebula3/data/DataObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,7 @@ def get_id(self):
timezone_offset=self.get_timezone_offset(),
)

@property
def tags(self):
"""get tag names
Expand All @@ -1406,8 +1407,8 @@ def properties(self, tag=None):
:return: the properties
"""
if tag is None:
if len(self.tags()) == 1:
tag = self.tags()[0]
if len(self.tags) == 1:
tag = self.tags[0]
else:
raise InvalidKeyException("tag name is required")

Expand Down

0 comments on commit 46abb84

Please sign in to comment.