Sfoglia il codice sorgente

remove uid from method signatures (#1269)

Co-authored-by: Fred Lefévère-Laoide <Fred.Lefevere-Laoide@Taipy.io>
Fred Lefévère-Laoide 1 anno fa
parent
commit
38c5dfb673
2 ha cambiato i file con 13 aggiunte e 13 eliminazioni
  1. 6 6
      taipy/gui_core/_context.py
  2. 7 7
      tests/gui_core/test_context_is_readable.py

+ 6 - 6
taipy/gui_core/_context.py

@@ -736,7 +736,7 @@ class _GuiCoreContext(CoreEventConsumerBase):
         # we might be comparing naive and aware datetime ISO
         return entity.creation_date.isoformat()
 
-    def get_scenarios_for_owner(self, owner_id: str, uid: str):
+    def get_scenarios_for_owner(self, owner_id: str):
         cycles_scenarios: t.List[t.Union[Scenario, Cycle]] = []
         with self.lock:
             if self.scenario_by_cycle is None:
@@ -756,7 +756,7 @@ class _GuiCoreContext(CoreEventConsumerBase):
                         cycles_scenarios.append(entity)
         return sorted(cycles_scenarios, key=_GuiCoreContext.get_entity_creation_date_iso)
 
-    def get_data_node_history(self, id: str, uid: str):
+    def get_data_node_history(self, id: str):
         if id and (dn := core_get(id)) and isinstance(dn, DataNode):
             res = []
             for e in dn.edits:
@@ -882,7 +882,7 @@ class _GuiCoreContext(CoreEventConsumerBase):
                 _GuiCoreContext.__assign_var(state, error_var, f"Error updating Datanode tabular value. {e}")
         _GuiCoreContext.__assign_var(state, payload.get("data_id"), dn_id)
 
-    def get_data_node_properties(self, id: str, uid: str):
+    def get_data_node_properties(self, id: str):
         if id and is_readable(t.cast(DataNodeId, id)) and (dn := core_get(id)) and isinstance(dn, DataNode):
             try:
                 return (
@@ -899,7 +899,7 @@ class _GuiCoreContext(CoreEventConsumerBase):
     def __read_tabular_data(self, datanode: DataNode):
         return datanode.read()
 
-    def get_data_node_tabular_data(self, id: str, uid: str):
+    def get_data_node_tabular_data(self, id: str):
         if (
             id
             and is_readable(t.cast(DataNodeId, id))
@@ -915,7 +915,7 @@ class _GuiCoreContext(CoreEventConsumerBase):
                 return None
         return None
 
-    def get_data_node_tabular_columns(self, id: str, uid: str):
+    def get_data_node_tabular_columns(self, id: str):
         if (
             id
             and is_readable(t.cast(DataNodeId, id))
@@ -933,7 +933,7 @@ class _GuiCoreContext(CoreEventConsumerBase):
                 return None
         return None
 
-    def get_data_node_chart_config(self, id: str, uid: str):
+    def get_data_node_chart_config(self, id: str):
         if (
             id
             and is_readable(t.cast(DataNodeId, id))

+ 7 - 7
tests/gui_core/test_context_is_readable.py

@@ -358,7 +358,7 @@ class TestGuiCoreContext_is_readable:
     def test_get_scenarios_for_owner(self):
         with patch("taipy.gui_core._context.core_get", side_effect=mock_core_get) as mockget:
             gui_core_context = _GuiCoreContext(Mock())
-            gui_core_context.get_scenarios_for_owner(a_scenario.id, "")
+            gui_core_context.get_scenarios_for_owner(a_scenario.id)
             mockget.assert_called_once()
             mockget.reset_mock()
 
@@ -440,32 +440,32 @@ class TestGuiCoreContext_is_readable:
     def test_get_data_node_tabular_data(self):
         with patch("taipy.gui_core._context.core_get", side_effect=mock_core_get) as mockget:
             gui_core_context = _GuiCoreContext(Mock())
-            gui_core_context.get_data_node_tabular_data(a_datanode.id, "")
+            gui_core_context.get_data_node_tabular_data(a_datanode.id)
             mockget.assert_called_once()
             mockget.reset_mock()
 
             with patch("taipy.gui_core._context.is_readable", side_effect=mock_is_readable_false):
-                gui_core_context.get_data_node_tabular_data(a_datanode.id, "")
+                gui_core_context.get_data_node_tabular_data(a_datanode.id)
                 mockget.assert_not_called()
 
     def test_get_data_node_tabular_columns(self):
         with patch("taipy.gui_core._context.core_get", side_effect=mock_core_get) as mockget:
             gui_core_context = _GuiCoreContext(Mock())
-            gui_core_context.get_data_node_tabular_columns(a_datanode.id, "")
+            gui_core_context.get_data_node_tabular_columns(a_datanode.id)
             mockget.assert_called_once()
             mockget.reset_mock()
 
             with patch("taipy.gui_core._context.is_readable", side_effect=mock_is_readable_false):
-                gui_core_context.get_data_node_tabular_columns(a_datanode, a_datanode.id)
+                gui_core_context.get_data_node_tabular_columns(a_datanode.id)
                 mockget.assert_not_called()
 
     def test_get_data_node_chart_config(self):
         with patch("taipy.gui_core._context.core_get", side_effect=mock_core_get) as mockget:
             gui_core_context = _GuiCoreContext(Mock())
-            gui_core_context.get_data_node_chart_config(a_datanode.id, "")
+            gui_core_context.get_data_node_chart_config(a_datanode.id)
             mockget.assert_called_once()
             mockget.reset_mock()
 
             with patch("taipy.gui_core._context.is_readable", side_effect=mock_is_readable_false):
-                gui_core_context.get_data_node_chart_config(a_datanode.id, "")
+                gui_core_context.get_data_node_chart_config(a_datanode.id)
                 mockget.assert_not_called()