Part of #1075. Depends on #1092 (Phase 3).
What
parallel.py imports both State and StateData and constructs StateData() instances directly — more than any other stage file.
_ParallelExecutor.__init__ currently takes parent_data: StateData. Change to accept parent_state: State (use gremlin.state) and derive the same fields from parent_state.data.*.
- Remove the two
StateData() constructor calls in parallel.py.
- Replace all
state.X with gremlin.state.X in stage bodies.
- Remove
from gremlins.executor.state import State, StateData from parallel.py.
parallel_state.py imports StateData and resolve_state_file; audit whether those can be replaced by accessing fields through the Gremlin instance that ParallelStage already holds via self.gremlin.
Files
gremlins/stages/parallel.py
gremlins/executor/parallel_state.py
Part of #1075. Depends on #1092 (Phase 3).
What
parallel.pyimports bothStateandStateDataand constructsStateData()instances directly — more than any other stage file._ParallelExecutor.__init__currently takesparent_data: StateData. Change to acceptparent_state: State(usegremlin.state) and derive the same fields fromparent_state.data.*.StateData()constructor calls inparallel.py.state.Xwithgremlin.state.Xin stage bodies.from gremlins.executor.state import State, StateDatafromparallel.py.parallel_state.pyimportsStateDataandresolve_state_file; audit whether those can be replaced by accessing fields through theGremlininstance thatParallelStagealready holds viaself.gremlin.Files
gremlins/stages/parallel.pygremlins/executor/parallel_state.py