From fba38bb241e8eb8bb786f3803bd5f94ddcce44ba Mon Sep 17 00:00:00 2001 From: markus <markus.holzer@fau.de> Date: Thu, 18 Jun 2020 08:20:55 +0200 Subject: [PATCH] Fixed pandas deprication warning --- .gitlab-ci.yml | 2 ++ conftest.py | 6 ++++-- pystencils/runhelper/db.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 25fd96697..ee89c5c98 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,7 @@ tests-and-coverage: - $ENABLE_NIGHTLY_BUILDS image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full script: + - env - pip list - export NUM_CORES=$(nproc --all) - mkdir -p ~/.config/matplotlib @@ -73,6 +74,7 @@ ubuntu: - $ENABLE_NIGHTLY_BUILDS image: i10git.cs.fau.de:5005/pycodegen/pycodegen/ubuntu script: + - pip install --upgrade pytest - mkdir -p ~/.config/matplotlib - echo "backend:template" > ~/.config/matplotlib/matplotlibrc - sed -i 's/--doctest-modules //g' pytest.ini diff --git a/conftest.py b/conftest.py index 980df61cc..eba25a742 100644 --- a/conftest.py +++ b/conftest.py @@ -151,7 +151,8 @@ class IPyNbFile(pytest.File): warnings.filterwarnings("ignore", "IPython.core.inputsplitter is deprecated") notebook = nbformat.read(notebook_contents, 4) code, _ = exporter.from_notebook_node(notebook) - yield IPyNbTest.from_parent(name=self.name, parent=self, code=code) + yield IPyNbTest(self.name, self, code) + # pytest v 2.4>: yield IPyNbTest.from_parent(name=self.name, parent=self, code=code) def teardown(self): pass @@ -160,4 +161,5 @@ class IPyNbFile(pytest.File): def pytest_collect_file(path, parent): glob_exprs = ["*demo*.ipynb", "*tutorial*.ipynb", "test_*.ipynb"] if any(path.fnmatch(g) for g in glob_exprs): - return IPyNbFile.from_parent(fspath=path, parent=parent) + return IPyNbFile(path, parent) + # pytest v 2.4 >: return IPyNbFile.from_parent(fspath=path, parent=parent) diff --git a/pystencils/runhelper/db.py b/pystencils/runhelper/db.py index bc3aa0a9e..21b75c4ba 100644 --- a/pystencils/runhelper/db.py +++ b/pystencils/runhelper/db.py @@ -120,7 +120,7 @@ class Database: Returns: pandas data frame """ - from pandas.io.json import json_normalize + from pandas import json_normalize query_result = self.filter_params(parameter_query) attributes = [e.attributes for e in query_result] -- GitLab