2424from lightning_app .core .queues import BaseQueue , SingleProcessQueue
2525from lightning_app .core .work import LightningWork
2626from lightning_app .frontend import Frontend
27- from lightning_app .storage import Drive , Path
27+ from lightning_app .storage import Drive , Path , Payload
2828from lightning_app .storage .path import _storage_root_dir
2929from lightning_app .utilities import frontend
3030from lightning_app .utilities .app_helpers import (
@@ -630,8 +630,16 @@ def _extract_vars_from_component_name(component_name: str, state):
630630 else :
631631 return None
632632
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+ }
635643
636644 def _send_flow_to_work_deltas (self , state ) -> None :
637645 if not self .flow_to_work_delta_queues :
@@ -652,10 +660,6 @@ def _send_flow_to_work_deltas(self, state) -> None:
652660 if state_work is None or last_state_work is None :
653661 continue
654662
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-
659663 deep_diff = DeepDiff (last_state_work , state_work , verbose_level = 2 ).to_dict ()
660664
661665 if "unprocessed" in deep_diff :
0 commit comments