Skip to content
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

feat(datasets): Add Support Python 3.11 for kedro-datasets #297

Merged
merged 88 commits into from
Aug 24, 2023

Conversation

SajidAlamQB
Copy link
Contributor

@SajidAlamQB SajidAlamQB commented Aug 10, 2023

Description

Add Python 3.11 support for Kedro-datasets

Development notes

  • Updated Github actions with new job that checks if plugin == kedro-datasets and adds 3.11 to the setup matrix if it does. This helps unit tests to run on python 3.11 only for kedro-datasets.

Checklist

  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change in the relevant RELEASE.md file
  • Added tests to cover my changes

@SajidAlamQB SajidAlamQB changed the title Attempt to support Python 3.11 feat: Attempt to support Python 3.11 Aug 10, 2023
@SajidAlamQB SajidAlamQB changed the title feat: Attempt to support Python 3.11 feat: Attempt to support Python 3.11 for kedro-datasets Aug 11, 2023
@SajidAlamQB SajidAlamQB linked an issue Aug 11, 2023 that may be closed by this pull request
@astrojuanlu
Copy link
Member

Collecting tables>=3.6 (from kedro-datasets==1.5.1)
  Downloading tables-3.7.0.tar.gz (8.2 MB)

weird! latest version is 3.8, and it definitely has precompiled wheels for 3.11 https://pypi.org/project/tables/3.8.0/#files

I can't reproduce locally:

docker run -it --rm --platform linux/amd64 python:3.11-slim bash
root@48174f6489bd:/# pip install "tables>=3.6"
Collecting tables>=3.6
  Downloading tables-3.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.5/6.5 MB 12.9 MB/s eta 0:00:00

you can try adding tables >= 3.8 ; python_version >= '3.11' (didn't test this syntax, but you get the idea)

@astrojuanlu
Copy link
Member

Oh but earlier in the logs we see this:

Collecting tables>=3.6 (from kedro-datasets==1.5.1)
  Downloading tables-3.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.5 MB)

so, I think pip might be backtracking here because of some incompatibility.

Since this is ubuntu-latest, maybe you can do apt-get install libhdf5-dev, so even without a wheel the installation works. But I'd try the >=3.8 first so that we can identify where the incompatibility is coming from.

@astrojuanlu
Copy link
Member

Welp, there seems to be some incompatibility with the dependencies 😬 After 47 minutes of heavy backtracking, still no solution https://github.com/kedro-org/kedro-plugins/actions/runs/5865409178/job/15902606193?pr=297

I contributed some additional logging to pip that made it to >= 23.1 pypa/pip#10937 and maybe it can help in this situation. My recommendation is to do pip install -vv (or alternatively, set the environment variable PIP_VERBOSE=2 https://pip.pypa.io/en/stable/topics/configuration/#environment-variables) so we can see the INFO: Will try a different candidate, due to conflict: messages.

Copy link
Contributor

@noklam noklam left a comment

Choose a reason for hiding this comment

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

Lgtm!

Copy link
Contributor

@ankatiyar ankatiyar left a comment

Choose a reason for hiding this comment

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

Thanks @SajidAlamQB! ⭐

@SajidAlamQB SajidAlamQB merged commit 062d570 into main Aug 24, 2023
@SajidAlamQB SajidAlamQB deleted the bump/python-3.11-support branch August 24, 2023 14:20
@astrojuanlu
Copy link
Member

Fantastic job @SajidAlamQB and team 👏🏽

PtrBld pushed a commit to PtrBld/kedro-plugins that referenced this pull request Aug 27, 2023
…#297)

* Add 3.11 tests to CI

* update dependencies

* 3.11 should only run on kedro-datasets

* update setup matrix

* refine setup matrix

* use steps

* pytables for unix

* add pytables via conda

* fix indent

* add conda

* activate windows

* undo last commit

* remove pytables conda install

* Update pyproject.toml

* pin pytables 3.8 for python 3.11

* lint

* pin sqlalchemy for 3.11

* install gfortran

* add pip_verbose and run onlu ubuntu tests

* undo gfortran install

* Update pyproject.toml

* add conda install pytables

* remove tables from pyproject.toml

* Update pyproject.toml

* pin tables 3.6 for unix

* Update pyproject.toml

* update pyspark

* Update check-plugin.yml

* change base spark dependency pin 3.4

* fix spark tests

* Update test_spark_jdbc_dataset.py

* coverage

* fix coverage

* Fix streaming dataset

* fix streaming test

* Update test_spark_hive_dataset.py

* fix base pin

* Remove delta-spark pin

Signed-off-by: Nok <[email protected]>

* lower pyspark pin for 3.11

* pin delta-spark to 2.4 for python 3.11

* Update conftest.py

* revert

* Set delta version base on delta-spark version

Signed-off-by: Nok <[email protected]>

* Update setup.py

* open-bound

* Update setup.py

* scikit pin

* Update setup.py

* Update pyproject.toml

* align with framework setup

* Update setup.py

* importlib_metadata backport

* add deltalake

* update holoviews pin

* remove miniconda and conda pytables

* add windows test back in running all parallel no spark

* Update check-plugin.yml

* add msbuild and run only windows

* Update check-plugin.yml

* lint

* lint

* update pandas pin

* replace semver with packaging

* lint

* lint

* add empty stacktrace for AnalysisException

* revert

* lint with 3.11

* update python version for linting

* Remove setup matrix

* Update check-plugin.yml

* Update check-plugin.yml

* overhaul python version and os pass in

* Update check-plugin.yml

* revert changes

* Update check-plugin.yml

* rtd with 3.8

* add snowflake-snowpark

* remove repeated

* release notes

---------

Signed-off-by: Nok <[email protected]>
Co-authored-by: Nok Lam Chan <[email protected]>
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.

Add Python3.11 support for kedro-datasets
4 participants