Commit 00e796f
Fix pandas 3.0 compatibility: StringDtype, datetime resolution, deprecated APIs, pyspark.pandas import (#1527)
* Initial plan
* Fix pandas 3.0 compatibility: StringDtype, datetime resolution, deprecated APIs
- Add "str" to string dtype name checks in data.py, ts_data.py, generic_task.py
(pandas 3.0 uses StringDtype(na_value=nan) with dtype.name="str")
- Wrap np.issubdtype(columns.dtype, np.integer) in try/except for StringDtype
column indexes in pandas 3.0
- Use is_datetime64_any_dtype() instead of hardcoded "datetime64[ns]" check
(pandas 3.0 uses varying datetime resolutions like datetime64[s], [ms], [us])
- Replace fillna(method="ffill") with ffill() in test files (removed in pandas 3.0)
- Replace deprecated frequency aliases "T"->"min", "H"->"h" in test files
Agent-Logs-Url: https://github.com/microsoft/FLAML/sessions/e2339d06-2236-4c1e-901b-b00a558f3796
Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
* CI: pin pandas 2 on ubuntu+python3.12 for backward compat testing
Agent-Logs-Url: https://github.com/microsoft/FLAML/sessions/7c3ce4f8-8623-4d3e-8986-2fa83e1daa5a
Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
* Add is_datetime64_any_dtype fallback in ts_data.py except ImportError block
Agent-Logs-Url: https://github.com/microsoft/FLAML/sessions/2b20aa86-81b1-4b3b-b6af-0cf7669c5575
Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
* Guard is_datetime64_any_dtype calls with None check in ts_data.py
Agent-Logs-Url: https://github.com/microsoft/FLAML/sessions/395c2eef-887f-4278-a4e0-4d4d276afeee
Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
* Fix Spark test failures: separate core pyspark imports from pyspark.pandas
Agent-Logs-Url: https://github.com/microsoft/FLAML/sessions/28e597b7-ae5e-41ba-957d-04aaa78834bd
Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
* Narrow pyspark.pandas fallback to ImportError instead of broad Exception
Agent-Logs-Url: https://github.com/microsoft/FLAML/sessions/28e597b7-ae5e-41ba-957d-04aaa78834bd
Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
* Guard set_option and ps.from_pandas calls in to_pandas_on_spark when pyspark.pandas unavailable
Agent-Logs-Url: https://github.com/microsoft/FLAML/sessions/60ca1746-e262-40e3-a970-2db40bda57dd
Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
* Pin pandas<3 for all pyspark environments and add pandas<3 to spark extra in setup.py
Agent-Logs-Url: https://github.com/microsoft/FLAML/sessions/0512ff2f-87ab-4394-b688-ea1416c26c6a
Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
Co-authored-by: Li Jiang <bnujli@gmail.com>1 parent 82ebcf5 commit 00e796f
10 files changed
Lines changed: 53 additions & 21 deletions
File tree
- .github/workflows
- flaml/automl
- spark
- task
- time_series
- test/automl
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
302 | 307 | | |
303 | 308 | | |
304 | 309 | | |
305 | | - | |
| 310 | + | |
306 | 311 | | |
307 | 312 | | |
308 | 313 | | |
| |||
318 | 323 | | |
319 | 324 | | |
320 | 325 | | |
321 | | - | |
| 326 | + | |
322 | 327 | | |
323 | 328 | | |
324 | 329 | | |
| |||
347 | 352 | | |
348 | 353 | | |
349 | 354 | | |
350 | | - | |
351 | | - | |
352 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
353 | 360 | | |
354 | 361 | | |
355 | 362 | | |
| |||
435 | 442 | | |
436 | 443 | | |
437 | 444 | | |
438 | | - | |
| 445 | + | |
439 | 446 | | |
440 | 447 | | |
441 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 10 | | |
15 | 11 | | |
16 | 12 | | |
| |||
29 | 25 | | |
30 | 26 | | |
31 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
32 | 42 | | |
33 | 43 | | |
34 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
72 | 80 | | |
73 | 81 | | |
74 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
275 | | - | |
| 276 | + | |
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
| |||
403 | 404 | | |
404 | 405 | | |
405 | 406 | | |
406 | | - | |
| 407 | + | |
407 | 408 | | |
408 | 409 | | |
409 | 410 | | |
410 | 411 | | |
411 | | - | |
| 412 | + | |
412 | 413 | | |
413 | 414 | | |
414 | 415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
213 | | - | |
| 212 | + | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | | - | |
| 190 | + | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
0 commit comments