24
24
from lightning_app .core .queues import BaseQueue , SingleProcessQueue
25
25
from lightning_app .core .work import LightningWork
26
26
from lightning_app .frontend import Frontend
27
- from lightning_app .storage import Drive , Path
27
+ from lightning_app .storage import Drive , Path , Payload
28
28
from lightning_app .storage .path import _storage_root_dir
29
29
from lightning_app .utilities import frontend
30
30
from lightning_app .utilities .app_helpers import (
@@ -630,8 +630,16 @@ def _extract_vars_from_component_name(component_name: str, state):
630
630
else :
631
631
return None
632
632
633
- # Note: Remove private keys
634
- return {k : v for k , v in child ["vars" ].items () if not k .startswith ("_" )}
633
+ # Filter private keys and drives
634
+ return {
635
+ k : v
636
+ for k , v in child ["vars" ].items ()
637
+ if (
638
+ not k .startswith ("_" )
639
+ and not (isinstance (v , dict ) and v .get ("type" , None ) == "__drive__" )
640
+ and not (isinstance (v , (Payload , Path )))
641
+ )
642
+ }
635
643
636
644
def _send_flow_to_work_deltas (self , state ) -> None :
637
645
if not self .flow_to_work_delta_queues :
@@ -652,10 +660,6 @@ def _send_flow_to_work_deltas(self, state) -> None:
652
660
if state_work is None or last_state_work is None :
653
661
continue
654
662
655
- # Note: The flow shouldn't update path or drive manually.
656
- last_state_work = apply_to_collection (last_state_work , (Path , Drive ), lambda x : None )
657
- state_work = apply_to_collection (state_work , (Path , Drive ), lambda x : None )
658
-
659
663
deep_diff = DeepDiff (last_state_work , state_work , verbose_level = 2 ).to_dict ()
660
664
661
665
if "unprocessed" in deep_diff :
0 commit comments