-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Fix unable to build Pandas with xlc on z/OS #35829
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 12 commits
b66b684
1189832
6484a7f
41edd64
6ed53e2
0a9db95
1d18312
fb39c51
4ba6b14
9724b3d
cb45dda
e481b08
02591d9
18688a1
06f304c
a072833
28ff707
2c7d3f7
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 |
---|---|---|
|
@@ -903,6 +903,9 @@ Styler | |
|
||
Other | ||
^^^^^ | ||
- Bug in :class:`Index` constructor sometimes silently ignorning a a specified ``dtype`` (:issue:`38879`) | ||
- | ||
======= | ||
- Bug in :class:`Index` constructor sometimes silently ignoring a specified ``dtype`` (:issue:`38879`) | ||
- Bug in :func:`pandas.api.types.infer_dtype` not recognizing Series, Index or array with a period dtype (:issue:`23553`) | ||
- Bug in :func:`pandas.api.types.infer_dtype` raising an error for general :class:`.ExtensionArray` objects. It will now return ``"unknown-array"`` instead of raising (:issue:`37367`) | ||
|
@@ -913,6 +916,7 @@ Other | |
- Bug in :func:`pandas.testing.assert_series_equal`, :func:`pandas.testing.assert_frame_equal`, :func:`pandas.testing.assert_index_equal` and :func:`pandas.testing.assert_extension_array_equal` incorrectly raising when an attribute has an unrecognized NA type (:issue:`39461`) | ||
- Bug in :meth:`DataFrame.equals`, :meth:`Series.equals`, :meth:`Index.equals` with object-dtype containing ``np.datetime64("NaT")`` or ``np.timedelta64("NaT")`` (:issue:`39650`) | ||
- Bug in :func:`pandas.util.show_versions` where console JSON output was not proper JSON (:issue:`39701`) | ||
- Fixed Pandas not being able to compile on z/OS when using xlc (:issue:`35826`) | ||
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. can you add a link to xlc |
||
- Bug in :meth:`DataFrame.convert_dtypes` incorrectly raised ValueError when called on an empty DataFrame (:issue:`40393`) | ||
- Bug in :meth:`DataFrame.clip` not interpreting missing values as no threshold (:issue:`40420`) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,10 @@ def is_platform_mac(): | |
return sys.platform == "darwin" | ||
|
||
|
||
def is_platform_zos(): | ||
return sys.platform == "zos" | ||
|
||
|
||
min_cython_ver = "0.29.21" # note: sync with pyproject.toml | ||
|
||
try: | ||
|
@@ -569,15 +573,31 @@ def srcpath(name=None, suffix=".pyx", subdir="src"): | |
include = data.get("include", []) | ||
include.append(numpy.get_include()) | ||
|
||
extra_comp_args = extra_compile_args.copy() | ||
comp_macros = data.get("macros", macros) | ||
undef_macros = [] | ||
|
||
if is_platform_zos(): | ||
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 don't see why we need this function, why not simply 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 had added it to be consistent with how the other platforms handled it. I've minimized the change as suggested. |
||
language = data.get("language", None) | ||
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.
This file is huge, so would prefer to not make this unnecessarily longer. 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. Done, thanks! |
||
if language == "c++": | ||
compiler = os.environ.get("CXX", "/bin/xlc++") | ||
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. Why we do assume that if 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. On z/OS, xlc/xlc++ is the default compiler that is provided, so most users will have it. |
||
compiler_name = os.path.basename(compiler) | ||
|
||
if (compiler_name == "xlc") or (compiler_name == "xlc++"): | ||
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. Feels that all these if could be just a single condition: if sys.platform == "zos" and data.get('language') == 'c++' and os.path.basename(os.environ.get('CXX')) in ('xlc', 'xlc++'): Does it make sense? 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. Yup - I've made this change. Thanks |
||
comp_macros.append(("__s390__", "1")) | ||
extra_comp_args.append("-qlanglvl=extended0x:nolibext") | ||
undef_macros.append("_POSIX_THREADS") | ||
|
||
obj = Extension( | ||
f"pandas.{name}", | ||
sources=sources, | ||
depends=data.get("depends", []), | ||
include_dirs=include, | ||
language=data.get("language", "c"), | ||
define_macros=data.get("macros", macros), | ||
extra_compile_args=extra_compile_args, | ||
define_macros=comp_macros, | ||
extra_compile_args=extra_comp_args, | ||
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. Is 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.
|
||
extra_link_args=extra_link_args, | ||
undef_macros=undef_macros, | ||
) | ||
|
||
extensions.append(obj) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated entry, pls revert