Commit 3b2587c
committed
feat: Add read_arrow methods to Session and pandas
Adds `read_arrow` methods to `bigframes.session.Session` and
`bigframes.pandas.read_arrow` for creating BigQuery DataFrames
DataFrames from PyArrow Tables.
The implementation refactors existing logic from
`bigframes.session._io.bigquery.read_gbq_query` for converting
Arrow data into BigFrames DataFrames.
Includes:
- New file `bigframes/session/_io/arrow.py` with the core conversion logic.
- `read_arrow(pa.Table) -> bpd.DataFrame` in `Session` class.
- `read_arrow(pa.Table) -> bpd.DataFrame` in `pandas` module.
- Unit and system tests for the new functionality.
- Docstrings for new methods/functions.
Note: Unit tests for direct DataFrame operations (shape, to_pandas) on
the result of read_arrow are currently failing due to the complexity of
mocking the session and executor for LocalDataNode interactions.
System tests are recommended for full end-to-end validation.1 parent 38cc43f commit 3b2587c
File tree
105 files changed
+5154
-1476
lines changed- bigframes
- _config
- core
- compile
- googlesql
- sqlglot
- expressions
- indexes
- rewrite
- functions
- ml
- operations
- pandas
- core/methods
- io
- session
- _io
- bigquery
- testing
- notebooks
- dataframes
- experimental
- generative_ai
- multimodal
- samples/snippets
- tests
- system
- large
- blob
- operations
- small
- engines
- operations
- pandas/core/methods
- unit
- core
- compile/sqlglot
- snapshots
- test_compile_concat/test_compile_concat
- test_compile_explode
- test_compile_explode_dataframe
- test_compile_explode_series
- test_compile_filter/test_compile_filter
- test_compile_projection/test_compile_projection
- test_compile_readlocal
- test_compile_readlocal_w_json_df
- test_compile_readlocal_w_lists_df
- test_compile_readlocal_w_structs_df
- test_compile_readlocal
- test_compile_readtable
- test_compile_readtable_w_json_types
- test_compile_readtable_w_limit
- test_compile_readtable_w_nested_structs_types
- test_compile_readtable_w_ordering
- test_compile_readtable_w_repeated_types
- test_compile_readtable
- test_compile_scalar_expr
- test_compile_numerical_add_w_scalar
- test_compile_numerical_add
- test_compile_string_add
- functions
- ml
- session
- third_party/bigframes_vendored
- google_cloud_bigquery
- pandas/core
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
105 files changed
+5154
-1476
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
7 | 55 | | |
8 | 56 | | |
9 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 58 | + | |
81 | 59 | | |
82 | 60 | | |
83 | 61 | | |
| |||
87 | 65 | | |
88 | 66 | | |
89 | 67 | | |
90 | | - | |
| 68 | + | |
91 | 69 | | |
92 | 70 | | |
93 | 71 | | |
94 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
95 | 105 | | |
96 | 106 | | |
97 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
98 | 110 | | |
99 | 111 | | |
100 | 112 | | |
101 | 113 | | |
| 114 | + | |
| 115 | + | |
102 | 116 | | |
103 | 117 | | |
104 | 118 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | 119 | | |
111 | 120 | | |
112 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
26 | 36 | | |
27 | 37 | | |
28 | 38 | | |
| |||
278 | 288 | | |
279 | 289 | | |
280 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
281 | 298 | | |
282 | 299 | | |
283 | 300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| |||
160 | 159 | | |
161 | 160 | | |
162 | 161 | | |
163 | | - | |
| 162 | + | |
164 | 163 | | |
165 | 164 | | |
166 | 165 | | |
167 | 166 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
231 | 180 | | |
232 | 181 | | |
233 | | - | |
234 | | - | |
235 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
236 | 185 | | |
237 | | - | |
238 | 186 | | |
239 | 187 | | |
240 | 188 | | |
241 | 189 | | |
242 | 190 | | |
243 | 191 | | |
244 | 192 | | |
245 | | - | |
| 193 | + | |
246 | 194 | | |
247 | 195 | | |
248 | 196 | | |
| |||
3397 | 3345 | | |
3398 | 3346 | | |
3399 | 3347 | | |
3400 | | - | |
3401 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
87 | 93 | | |
88 | 94 | | |
89 | 95 | | |
| |||
119 | 125 | | |
120 | 126 | | |
121 | 127 | | |
122 | | - | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| |||
0 commit comments