Skip to content

Commit

Permalink
@trgiangdo comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred Lefévère-Laoide authored and Fred Lefévère-Laoide committed Oct 19, 2024
1 parent c02a52d commit 1c622f9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions taipy/core/data/data_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import networkx as nx

from taipy.common.config import Config
from taipy.common.config.common._validate_id import _validate_id
from taipy.common.config.common.scope import Scope
from taipy.common.logger._taipy_logger import _TaipyLogger

from ... import Config
from .._entity._entity import _Entity
from .._entity._labeled import _Labeled
from .._entity._properties import _Properties
Expand Down Expand Up @@ -573,16 +573,21 @@ def get_last_edit(self) -> Optional[Edit]:
return self._edits[-1] if self._edits else None

def get_rank(self) -> int:
"""Get the rank of this data node regarding to its scenario owner
Returns:
The int value representing the rank.
"""
if not self.owner_id:
return 0xffff
return 0xfffe
config = Config.data_nodes.get(self.config_id, None)
if not config:
return 0xfffc
return 0xfffd

from ... import core as tp
owner = tp.get(self.owner_id)
if not isinstance(owner, tp.Scenario):
return 0xfffe
return 0xfffc
return config._ranks.get(owner.config_id, 0xfffb)

@abstractmethod
Expand Down

0 comments on commit 1c622f9

Please sign in to comment.