Skip to content

Commit 685fa3e

Browse files
authored
docs: tip on context managers for efficient remote processing (#2634)
1 parent 16de04b commit 685fa3e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/source/user_guide/tutorials/data_structures/data_arrays.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,3 +566,11 @@ a field's data can be recovered locally before sending a large number of request
566566
with my_temp_field.as_local_field() as f:
567567
for i in range(1,100):
568568
f.get_entity_data_by_id(i)
569+
570+
.. tip::
571+
572+
When using a remote DPF server, accessing a field's data within the ``with`` context manager
573+
ensures deletion of local data when exiting the ``with`` block. Following this approach is
574+
advisable for efficient remote processing workflows since it guarantees non-persistence of
575+
unnecessary local data, especially if the data is not needed beyond the code being executed
576+
within the ``with`` block.

0 commit comments

Comments
 (0)