Commit 3eda250
committed
refactor: replace ChunkInterrupted snapshot copies with live-view properties
Drop the .copy() snapshot of call.partial_frame and the stored
partial_response from ChunkInterrupted.__init__. Instead, partial_frame
and partial_response are now @Property delegates to self.call when
available, falling back to empty/None when call is None.
This avoids copying potentially large DataFrames on every
ChunkInterrupted raise — the primary usage pattern is exc.call.resume(),
not inspecting the partial data on the exception itself.
Pickling still works: __getstate__ snapshots the current partial_frame
and partial_response into private backing attributes that __setstate__
restores, so the degraded (call=None) unpickled form retains the data
that was available at serialization time.1 parent 5686d30 commit 3eda250
2 files changed
Lines changed: 74 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
141 | 157 | | |
142 | 158 | | |
143 | 159 | | |
| |||
146 | 162 | | |
147 | 163 | | |
148 | 164 | | |
149 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
150 | 184 | | |
151 | 185 | | |
152 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
954 | 954 | | |
955 | 955 | | |
956 | 956 | | |
957 | | - | |
958 | | - | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
964 | 962 | | |
965 | 963 | | |
966 | 964 | | |
| |||
977 | 975 | | |
978 | 976 | | |
979 | 977 | | |
980 | | - | |
981 | | - | |
| 978 | + | |
| 979 | + | |
982 | 980 | | |
983 | | - | |
| 981 | + | |
984 | 982 | | |
985 | 983 | | |
986 | | - | |
| 984 | + | |
987 | 985 | | |
988 | | - | |
989 | | - | |
| 986 | + | |
| 987 | + | |
990 | 988 | | |
991 | 989 | | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
1000 | | - | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
1001 | 996 | | |
1002 | 997 | | |
1003 | 998 | | |
| |||
1020 | 1015 | | |
1021 | 1016 | | |
1022 | 1017 | | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
1029 | 1023 | | |
1030 | 1024 | | |
1031 | 1025 | | |
| |||
0 commit comments