Skip to content

COMPAT: implement visit_Constant for 3.8 compat #28101

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

Merged
merged 8 commits into from
Aug 26, 2019

Conversation

TomAugspurger
Copy link
Contributor

@jorisvandenbossche
Copy link
Member

Do we plan to do a 0.25.2, or keep open the option? (basically meaning: do we keep backporting for now?) If so, this would be a candidate I think.

@jreback
Copy link
Contributor

jreback commented Aug 22, 2019

would be +1 on. potential 0.25.2 esp if we can have 3.8 support in it

@TomAugspurger
Copy link
Contributor Author

According to https://www.python.org/dev/peps/pep-0569/, the release date is targeted for October 21.

I'm not sure we'll get 1.0 out by then so a (conservative) 0.25.2 makes sense. Just plan to backport 3.8 fixes and 0.25 regressions?

@TomAugspurger
Copy link
Contributor Author

FYI, I need to read through https://bugs.python.org/issue36917 a bit more to make sure this is a valid fix. So consider this WIP for now.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm for 0.25.2

@WillAyd
Copy link
Member

WillAyd commented Aug 23, 2019

Once we get to 3.8 as a minimum we could get rid of the other types represented here right? If so maybe worth a comment of some sort

@jorisvandenbossche jorisvandenbossche added this to the 0.25.2 milestone Aug 23, 2019
(cherry picked from commit 582e8967ba64c47d188e4849a897ec599e06b1e6)
(cherry picked from commit 42893af2eef3b5ac4a342c5a7a287b4a0407005f)
(cherry picked from commit ffe9b6fa7bf86a99b32fc50b131bfab62005f49d)
(cherry picked from commit ca34ccddb47a102b25a2f23abeac28bc77d121ac)
@TomAugspurger
Copy link
Contributor Author

Updated with all the tests that were failing for me locally with 3.8.

Note that we can't test against 3.8 beta3 because a segfault would crash the test workers (I think). That's fixed in python/cpython#15390 which will be in beta 4.

@TomAugspurger
Copy link
Contributor Author

Once we get to 3.8 as a minimum we could get rid of the other types represented here right? If so maybe worth a comment of some sort

I'm not sure exactly which ones can be removed once 3.8 is our min version. I don't think I understand this code / the changes well enough to say.

@WillAyd
Copy link
Member

WillAyd commented Aug 26, 2019

Sounds good. Can cross that bridge when we get there

@WillAyd
Copy link
Member

WillAyd commented Aug 26, 2019

Unless someone else has objections I so go ahead and merge

@TomAugspurger TomAugspurger merged commit 765eb8d into pandas-dev:master Aug 26, 2019
@TomAugspurger TomAugspurger deleted the 3.8-visit-constant branch August 26, 2019 14:22
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Aug 26, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
* COMPAT: implement visit_Constant for 3.8 compat
* Updated tests for new error messages.
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
* COMPAT: implement visit_Constant for 3.8 compat
* Updated tests for new error messages.
msci-jordancrawford added a commit to olivermarchand/climada_python that referenced this pull request Sep 24, 2020
All dependencies are changed to >= dependencies, rather than ==, which make
climada suitable for use as a library. In addition, the following changes were
made to ensure compatability with lab:

 - Removed cartopy as a requirement, since it tends to break automation with its
   requirements on numpy at install time.
 - Downgrade the version of the following packages to match lab:
   - cython
   - geopandas
   - matplotlib
   - nbformat
   - numpy
   - pillow
   - xlrd
   - xlsxwriter
   - pandas
 - Change the specified dependence of proj==7.0.0 (which is a c library) to
   pyproj>=2.6, the python package the exposes proj API bindings in python.
 - Pin the following dependences (i.e. == instead of >=):
   - xarray==0.13.0 to stop it from bringing in a pandas>=0.25 dependency
   - gdal==3.0.4 version, since 3.0.4 is what ships with Ubuntu 20.04. Running
     higher versions causes compile time problems.
 - Include explicit dependencies on rtree (optional dep of geopandas) and fsspec
   (optional dep of dask)

This change is not without impact. There are known test failures on the
cannoncial lab setup (Ubuntu 20.04, Python 3.8, installed with
rebuild-venv.sh), including:

 - TypeError: visit_Constant() got an unexpected keyword argument 'side'
   in pandas code. This is a known error with pandas 0.24 when running on
   python 3.8 which is fixed in 0.25.2. See discussion at:
   - https://bugzilla.redhat.com/show_bug.cgi?id=1746847
   - pandas-dev/pandas#28101
 - In pandas, either:
     AttributeError: 'Series' object has no attribute 'to_numpy'
   or
     AttributeError: module 'pandas' has no attribute 'arrays'
   Both of these refer to pandas functionality introduced in 0.24.0 that is
   used directly by CLIMADA.
 - ModuleNotFoundError: No module named 'pyepsg'
   'pyepsg' is a wrapper tool that downloads epsg info from the web. This is
   explicitly excluded in order to prevent production instances from relying on
   a third party site.
 - When pandas is reading an excel file, it uses the xlrd library, which
   references the time.clock() API, which has been long deprecated and was
   completley removed in Python 3.8.

Note that most of these errors could be resolved by bumping the pandas version
to 0.25.2, a change which is pending further work in lab.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pandas-0.25.0rc0 problem on Python-3.8: 'PandasExprVisitor' object has no attribute 'visit_Constant'
6 participants