-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
CI: unpin pyarrow, fix failing test #51175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
b5a3dc2
b1e7679
5bc178f
7e5d92e
2fadab1
3bf4c14
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ dependencies: | |
- odfpy | ||
- py | ||
- psycopg2 | ||
- pyarrow<11 | ||
- pyarrow | ||
- pymysql | ||
- pyreadstat | ||
- pytables | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,9 +258,19 @@ def _from_sequence_of_strings( | |
|
||
scalars = to_datetime(strings, errors="raise").date | ||
elif pa.types.is_duration(pa_type): | ||
from pandas.core.tools.timedeltas import to_timedelta | ||
try: | ||
# GH51175: test_from_sequence_of_strings_pa_array | ||
# attempt to parse as int64 reflecting pyarrow's | ||
# duration to string casting behavior | ||
if isinstance(strings, (pa.Array, pa.ChunkedArray)): | ||
scalars = strings | ||
else: | ||
scalars = pa.array(strings, type=pa.string(), from_pandas=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO (slightly) I think we should still prefer to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think using
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in fact, the example provided above errors on main due to assuming ns units:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW there's a corner case with iNaT that pyarrow will handle differently from to_timedelta There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point re: It all feels a bit messy, but I don't see another option ATM. Open to suggestions. |
||
scalars = scalars.cast(pa.int64()) | ||
except pa.ArrowInvalid: | ||
from pandas.core.tools.timedeltas import to_timedelta | ||
|
||
scalars = to_timedelta(strings, errors="raise") | ||
scalars = to_timedelta(strings, errors="raise") | ||
elif pa.types.is_time(pa_type): | ||
from pandas.core.tools.times import to_time | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ openpyxl | |
odfpy | ||
py | ||
psycopg2-binary | ||
pyarrow<11 | ||
pyarrow | ||
pymysql | ||
pyreadstat | ||
tables | ||
|
Uh oh!
There was an error while loading. Please reload this page.