From 473db4576bdce220fade99e86a76918baaac5581 Mon Sep 17 00:00:00 2001 From: "P. Sai Vinay" <33659563+V1NAY8@users.noreply.github.com> Date: Mon, 16 Nov 2020 23:00:41 +0530 Subject: [PATCH] Move tests directory outside of eland namespace --- .gitignore | 6 +- CONTRIBUTING.md | 6 +- docs/sphinx/development/contributing.rst | 8 +- noxfile.py | 23 +- {eland/tests => tests}/__init__.py | 0 {eland/tests => tests}/anonreviews.csv.gz | Bin {eland/tests => tests}/common.py | 2 +- {eland/tests => tests}/conftest.py | 0 {eland/tests => tests}/dataframe/__init__.py | 0 .../dataframe/results/.gitignore | 0 .../dataframe/test_aggs_pytest.py | 2 +- .../dataframe/test_big_mapping_pytest.py | 2 +- .../dataframe/test_count_pytest.py | 2 +- .../dataframe/test_datetime_pytest.py | 2 +- .../dataframe/test_describe_pytest.py | 2 +- .../dataframe/test_dir_pytest.py | 2 +- .../dataframe/test_drop_pytest.py | 0 .../dataframe/test_dtypes_pytest.py | 2 +- .../dataframe/test_es_match_pytest.py | 2 +- .../dataframe/test_es_query_pytest.py | 2 +- .../dataframe/test_filter_pytest.py | 2 +- .../dataframe/test_get_pytest.py | 0 .../dataframe/test_getitem_pytest.py | 0 .../dataframe/test_groupby_pytest.py | 392 +++++++++--------- .../dataframe/test_head_tail_pytest.py | 2 +- .../dataframe/test_hist_pytest.py | 2 +- .../dataframe/test_info_pytest.py | 4 +- .../dataframe/test_init_pytest.py | 2 +- .../dataframe/test_keys_pytest.py | 2 +- .../dataframe/test_metrics_pytest.py | 2 +- .../dataframe/test_nunique_pytest.py | 2 +- .../dataframe/test_query_pytest.py | 2 +- .../dataframe/test_repr_pytest.py | 5 +- .../dataframe/test_sample_pytest.py | 2 +- .../dataframe/test_select_dtypes_pytest.py | 2 +- .../dataframe/test_shape_pytest.py | 2 +- .../dataframe/test_to_csv_pytest.py | 4 +- .../dataframe/test_utils_pytest.py | 4 +- {eland/tests => tests}/ecommerce.json.gz | Bin {eland/tests => tests}/ecommerce_df.json.gz | Bin {eland/tests => tests}/etl/__init__.py | 0 .../etl/test_pandas_to_eland.py | 2 +- .../field_mappings/__init__.py | 0 .../test_aggregatables_pytest.py | 4 +- .../field_mappings/test_datetime_pytest.py | 2 +- .../test_display_names_pytest.py | 4 +- .../field_mappings/test_dtypes_pytest.py | 4 +- .../test_field_name_pd_dtype_pytest.py | 4 +- .../test_get_field_names_pytest.py | 4 +- .../test_mappings_with_type_pytest.py | 2 +- .../test_metric_source_fields_pytest.py | 4 +- .../field_mappings/test_rename_pytest.py | 4 +- .../test_scripted_fields_pytest.py | 4 +- {eland/tests => tests}/flights.json.gz | Bin {eland/tests => tests}/flights_df.json.gz | Bin {eland/tests => tests}/flights_small.json.gz | Bin .../ml/test_imported_ml_model_pytest.py | 2 +- .../ml/test_optional_dependency_pytest.py | 0 .../operators => tests/notebook}/__init__.py | 0 .../notebook}/test_churn.csv | 4 +- .../notebook}/test_demo_notebook.ipynb | 0 .../notebook}/test_etl.ipynb | 26 +- .../notebook}/test_metrics.ipynb | 0 .../notebook}/test_plotting.ipynb | 0 .../test_map_pd_aggs_to_es_aggs_pytest.py | 0 .../series => tests/operators}/__init__.py | 0 .../operators/test_operators_pytest.py | 0 .../plotting/test_dataframe_hist_pytest.py | 2 +- .../plotting/test_series_hist_pytest.py | 2 +- .../query/test_count_pytest.py | 2 +- .../query_compiler/test_es_match_pytest.py | 2 +- .../test_get_field_names_pytest.py | 2 +- .../series}/__init__.py | 0 .../series/test_arithmetics_pytest.py | 2 +- .../series/test_describe_pytest.py | 2 +- .../series/test_dtype_pytest.py | 2 +- .../tests => tests}/series/test_es_match.py | 2 +- .../series/test_filter_pytest.py | 2 +- .../series/test_head_tail_pytest.py | 4 +- .../series/test_hist_pytest.py | 2 +- .../series/test_info_es_pytest.py | 2 +- .../series/test_metrics_pytest.py | 2 +- .../tests => tests}/series/test_na_pytest.py | 2 +- .../series/test_name_pytest.py | 4 +- .../series/test_rename_pytest.py | 4 +- .../series/test_repr_pytest.py | 4 +- .../series/test_sample_pytest.py | 4 +- .../series/test_str_arithmetics_pytest.py | 2 +- .../series/test_value_counts_pytest.py | 2 +- {eland/tests => tests}/setup_tests.py | 2 +- {eland/tests => tests}/test_utils_pytest.py | 0 91 files changed, 321 insertions(+), 297 deletions(-) rename {eland/tests => tests}/__init__.py (100%) rename {eland/tests => tests}/anonreviews.csv.gz (100%) rename {eland/tests => tests}/common.py (99%) rename {eland/tests => tests}/conftest.py (100%) rename {eland/tests => tests}/dataframe/__init__.py (100%) rename {eland/tests => tests}/dataframe/results/.gitignore (100%) rename {eland/tests => tests}/dataframe/test_aggs_pytest.py (99%) rename {eland/tests => tests}/dataframe/test_big_mapping_pytest.py (96%) rename {eland/tests => tests}/dataframe/test_count_pytest.py (97%) rename {eland/tests => tests}/dataframe/test_datetime_pytest.py (99%) rename {eland/tests => tests}/dataframe/test_describe_pytest.py (98%) rename {eland/tests => tests}/dataframe/test_dir_pytest.py (96%) rename {eland/tests => tests}/dataframe/test_drop_pytest.py (100%) rename {eland/tests => tests}/dataframe/test_dtypes_pytest.py (98%) rename {eland/tests => tests}/dataframe/test_es_match_pytest.py (97%) rename {eland/tests => tests}/dataframe/test_es_query_pytest.py (97%) rename {eland/tests => tests}/dataframe/test_filter_pytest.py (98%) rename {eland/tests => tests}/dataframe/test_get_pytest.py (100%) rename {eland/tests => tests}/dataframe/test_getitem_pytest.py (100%) rename {eland/tests => tests}/dataframe/test_groupby_pytest.py (97%) rename {eland/tests => tests}/dataframe/test_head_tail_pytest.py (98%) rename {eland/tests => tests}/dataframe/test_hist_pytest.py (98%) rename {eland/tests => tests}/dataframe/test_info_pytest.py (96%) rename {eland/tests => tests}/dataframe/test_init_pytest.py (96%) rename {eland/tests => tests}/dataframe/test_keys_pytest.py (97%) rename {eland/tests => tests}/dataframe/test_metrics_pytest.py (99%) rename {eland/tests => tests}/dataframe/test_nunique_pytest.py (97%) rename {eland/tests => tests}/dataframe/test_query_pytest.py (98%) rename {eland/tests => tests}/dataframe/test_repr_pytest.py (98%) rename {eland/tests => tests}/dataframe/test_sample_pytest.py (98%) rename {eland/tests => tests}/dataframe/test_select_dtypes_pytest.py (95%) rename {eland/tests => tests}/dataframe/test_shape_pytest.py (97%) rename {eland/tests => tests}/dataframe/test_to_csv_pytest.py (97%) rename {eland/tests => tests}/dataframe/test_utils_pytest.py (97%) rename {eland/tests => tests}/ecommerce.json.gz (100%) rename {eland/tests => tests}/ecommerce_df.json.gz (100%) rename {eland/tests => tests}/etl/__init__.py (100%) rename {eland/tests => tests}/etl/test_pandas_to_eland.py (99%) rename {eland/tests => tests}/field_mappings/__init__.py (100%) rename {eland/tests => tests}/field_mappings/test_aggregatables_pytest.py (98%) rename {eland/tests => tests}/field_mappings/test_datetime_pytest.py (99%) rename {eland/tests => tests}/field_mappings/test_display_names_pytest.py (97%) rename {eland/tests => tests}/field_mappings/test_dtypes_pytest.py (94%) rename {eland/tests => tests}/field_mappings/test_field_name_pd_dtype_pytest.py (93%) rename {eland/tests => tests}/field_mappings/test_get_field_names_pytest.py (96%) rename {eland/tests => tests}/field_mappings/test_mappings_with_type_pytest.py (98%) rename {eland/tests => tests}/field_mappings/test_metric_source_fields_pytest.py (98%) rename {eland/tests => tests}/field_mappings/test_rename_pytest.py (97%) rename {eland/tests => tests}/field_mappings/test_scripted_fields_pytest.py (95%) rename {eland/tests => tests}/flights.json.gz (100%) rename {eland/tests => tests}/flights_df.json.gz (100%) rename {eland/tests => tests}/flights_small.json.gz (100%) rename {eland/tests => tests}/ml/test_imported_ml_model_pytest.py (99%) rename {eland/tests => tests}/ml/test_optional_dependency_pytest.py (100%) rename {eland/tests/operators => tests/notebook}/__init__.py (100%) rename {eland/tests/tests_notebook => tests/notebook}/test_churn.csv (99%) rename {eland/tests/tests_notebook => tests/notebook}/test_demo_notebook.ipynb (100%) rename {eland/tests/tests_notebook => tests/notebook}/test_etl.ipynb (93%) rename {eland/tests/tests_notebook => tests/notebook}/test_metrics.ipynb (100%) rename {eland/tests/tests_notebook => tests/notebook}/test_plotting.ipynb (100%) rename {eland/tests => tests}/operations/test_map_pd_aggs_to_es_aggs_pytest.py (100%) rename {eland/tests/series => tests/operators}/__init__.py (100%) rename {eland/tests => tests}/operators/test_operators_pytest.py (100%) rename {eland/tests => tests}/plotting/test_dataframe_hist_pytest.py (98%) rename {eland/tests => tests}/plotting/test_series_hist_pytest.py (98%) rename {eland/tests => tests}/query/test_count_pytest.py (96%) rename {eland/tests => tests}/query_compiler/test_es_match_pytest.py (99%) rename {eland/tests => tests}/query_compiler/test_get_field_names_pytest.py (97%) rename {eland/tests/tests_notebook => tests/series}/__init__.py (100%) rename {eland/tests => tests}/series/test_arithmetics_pytest.py (99%) rename {eland/tests => tests}/series/test_describe_pytest.py (96%) rename {eland/tests => tests}/series/test_dtype_pytest.py (96%) rename {eland/tests => tests}/series/test_es_match.py (97%) rename {eland/tests => tests}/series/test_filter_pytest.py (97%) rename {eland/tests => tests}/series/test_head_tail_pytest.py (90%) rename {eland/tests => tests}/series/test_hist_pytest.py (98%) rename {eland/tests => tests}/series/test_info_es_pytest.py (96%) rename {eland/tests => tests}/series/test_metrics_pytest.py (99%) rename {eland/tests => tests}/series/test_na_pytest.py (96%) rename {eland/tests => tests}/series/test_name_pytest.py (92%) rename {eland/tests => tests}/series/test_rename_pytest.py (92%) rename {eland/tests => tests}/series/test_repr_pytest.py (95%) rename {eland/tests => tests}/series/test_sample_pytest.py (91%) rename {eland/tests => tests}/series/test_str_arithmetics_pytest.py (98%) rename {eland/tests => tests}/series/test_value_counts_pytest.py (98%) rename {eland/tests => tests}/setup_tests.py (99%) rename {eland/tests => tests}/test_utils_pytest.py (100%) diff --git a/.gitignore b/.gitignore index b522b86..f1fb05b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Compiled python modules. *.pyc +__pycache__/ # Setuptools distribution folder. dist/ @@ -11,18 +12,19 @@ build/ docs/build/ # pytest results -eland/tests/dataframe/results/ +tests/dataframe/results/*csv result_images/ # Python egg metadata, regenerated from source files by setuptools. /*.egg-info +eland.egg-info/ # PyCharm files .idea/ # vscode files -.vscode/* +.vscode/ # pytest files .pytest_cache/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9ec0ae4..0256cb1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -79,8 +79,8 @@ Once your changes and tests are ready to submit for review: $ nox -s format # Run the test suite - $ pytest --doctest-modules eland/tests/ - $ pytest --nbval eland/tests/tests_notebook/ + $ pytest --doctest-modules tests/ + $ pytest --nbval tests/notebook/ ``` @@ -182,7 +182,7 @@ currently using a minimum version of PyCharm 2019.2.4. * To setup test environment: ``` bash - > python -m eland.tests.setup_tests + > python -m tests.setup_tests ``` (Note this modifies Elasticsearch indices) diff --git a/docs/sphinx/development/contributing.rst b/docs/sphinx/development/contributing.rst index 04f1709..efd7f02 100644 --- a/docs/sphinx/development/contributing.rst +++ b/docs/sphinx/development/contributing.rst @@ -87,7 +87,7 @@ Once your changes and tests are ready to submit for review: # Run the test suite $ pytest --doctest-modules eland/tests/ - $ pytest --nbval eland/tests/tests_notebook/ + $ pytest --nbval eland/tests/notebook/ 2. Sign the Contributor License Agreement @@ -184,13 +184,13 @@ Configuring PyCharm And Running Tests - To setup test environment -*note this modifies Elasticsearch indices* run .. code-block:: bash - python -m eland.tests.setup_tests + python -m tests.setup_tests - To validate installation, open python console and run .. code-block:: bash - import eland as ed - ed_df = ed.DataFrame('localhost', 'flights') + import eland as ed + ed_df = ed.DataFrame('localhost', 'flights') - To run the automatic formatter and check for lint issues .. code-block:: bash diff --git a/noxfile.py b/noxfile.py index 565eea6..a048dcd 100644 --- a/noxfile.py +++ b/noxfile.py @@ -22,13 +22,7 @@ from pathlib import Path import nox BASE_DIR = Path(__file__).parent -SOURCE_FILES = ( - "setup.py", - "noxfile.py", - "eland/", - "docs/", - "utils/", -) +SOURCE_FILES = ("setup.py", "noxfile.py", "eland/", "docs/", "utils/", "tests/") # Whenever type-hints are completed on a file it should # be added here so that this file will continue to be checked @@ -98,15 +92,18 @@ def lint(session): @nox.session(python=["3.6", "3.7", "3.8"]) def test(session): session.install("-r", "requirements-dev.txt") - session.run("python", "-m", "eland.tests.setup_tests") + session.run("python", "-m", "tests.setup_tests") session.install(".") session.run( + "python", + "-m", "pytest", - "--cov=eland", + "--cov-report", + "term-missing", + "--cov=eland/", "--doctest-modules", - *(session.posargs or ("eland/",)), "--nbval", - "eland/tests/tests_notebook/", + *(session.posargs or ("eland/", "tests/")), ) session.run( @@ -119,7 +116,7 @@ def test(session): "xgboost", "lightgbm", ) - session.run("pytest", "eland/tests/ml/") + session.run("pytest", "tests/ml/") @nox.session(reuse_venv=True) @@ -138,7 +135,7 @@ def docs(session): es = elasticsearch.Elasticsearch("localhost:9200") es.info() if not es.indices.exists("flights"): - session.run("python", "-m", "eland.tests.setup_tests") + session.run("python", "-m", "tests.setup_tests") es_active = True except Exception: es_active = False diff --git a/eland/tests/__init__.py b/tests/__init__.py similarity index 100% rename from eland/tests/__init__.py rename to tests/__init__.py diff --git a/eland/tests/anonreviews.csv.gz b/tests/anonreviews.csv.gz similarity index 100% rename from eland/tests/anonreviews.csv.gz rename to tests/anonreviews.csv.gz diff --git a/eland/tests/common.py b/tests/common.py similarity index 99% rename from eland/tests/common.py rename to tests/common.py index 5c9905a..4fcaea7 100644 --- a/eland/tests/common.py +++ b/tests/common.py @@ -25,7 +25,7 @@ import eland as ed ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) # Create pandas and eland data frames -from eland.tests import ( +from tests import ( ECOMMERCE_DF_FILE_NAME, ECOMMERCE_INDEX_NAME, ES_TEST_CLIENT, diff --git a/eland/tests/conftest.py b/tests/conftest.py similarity index 100% rename from eland/tests/conftest.py rename to tests/conftest.py diff --git a/eland/tests/dataframe/__init__.py b/tests/dataframe/__init__.py similarity index 100% rename from eland/tests/dataframe/__init__.py rename to tests/dataframe/__init__.py diff --git a/eland/tests/dataframe/results/.gitignore b/tests/dataframe/results/.gitignore similarity index 100% rename from eland/tests/dataframe/results/.gitignore rename to tests/dataframe/results/.gitignore diff --git a/eland/tests/dataframe/test_aggs_pytest.py b/tests/dataframe/test_aggs_pytest.py similarity index 99% rename from eland/tests/dataframe/test_aggs_pytest.py rename to tests/dataframe/test_aggs_pytest.py index 54b05a2..2c37e5f 100644 --- a/eland/tests/dataframe/test_aggs_pytest.py +++ b/tests/dataframe/test_aggs_pytest.py @@ -21,7 +21,7 @@ import numpy as np import pytest from pandas.testing import assert_frame_equal, assert_series_equal -from eland.tests.common import TestData +from tests.common import TestData class TestDataFrameAggs(TestData): diff --git a/eland/tests/dataframe/test_big_mapping_pytest.py b/tests/dataframe/test_big_mapping_pytest.py similarity index 96% rename from eland/tests/dataframe/test_big_mapping_pytest.py rename to tests/dataframe/test_big_mapping_pytest.py index 425365c..5be539d 100644 --- a/eland/tests/dataframe/test_big_mapping_pytest.py +++ b/tests/dataframe/test_big_mapping_pytest.py @@ -18,7 +18,7 @@ # File called _pytest for PyCharm compatability import eland as ed -from eland.tests.common import ES_TEST_CLIENT, TestData +from tests.common import ES_TEST_CLIENT, TestData class TestDataFrameBigMapping(TestData): diff --git a/eland/tests/dataframe/test_count_pytest.py b/tests/dataframe/test_count_pytest.py similarity index 97% rename from eland/tests/dataframe/test_count_pytest.py rename to tests/dataframe/test_count_pytest.py index eff36fc..e57db99 100644 --- a/eland/tests/dataframe/test_count_pytest.py +++ b/tests/dataframe/test_count_pytest.py @@ -18,7 +18,7 @@ # File called _pytest for PyCharm compatability from pandas.testing import assert_series_equal -from eland.tests.common import TestData +from tests.common import TestData class TestDataFrameCount(TestData): diff --git a/eland/tests/dataframe/test_datetime_pytest.py b/tests/dataframe/test_datetime_pytest.py similarity index 99% rename from eland/tests/dataframe/test_datetime_pytest.py rename to tests/dataframe/test_datetime_pytest.py index 99ae51a..66a6cca 100644 --- a/eland/tests/dataframe/test_datetime_pytest.py +++ b/tests/dataframe/test_datetime_pytest.py @@ -24,7 +24,7 @@ from pandas.testing import assert_series_equal import eland as ed from eland.field_mappings import FieldMappings -from eland.tests.common import ( +from tests.common import ( ES_TEST_CLIENT, TestData, assert_pandas_eland_frame_equal, diff --git a/eland/tests/dataframe/test_describe_pytest.py b/tests/dataframe/test_describe_pytest.py similarity index 98% rename from eland/tests/dataframe/test_describe_pytest.py rename to tests/dataframe/test_describe_pytest.py index 4b1152e..e86caf4 100644 --- a/eland/tests/dataframe/test_describe_pytest.py +++ b/tests/dataframe/test_describe_pytest.py @@ -19,7 +19,7 @@ from pandas.testing import assert_frame_equal -from eland.tests.common import TestData +from tests.common import TestData class TestDataFrameDescribe(TestData): diff --git a/eland/tests/dataframe/test_dir_pytest.py b/tests/dataframe/test_dir_pytest.py similarity index 96% rename from eland/tests/dataframe/test_dir_pytest.py rename to tests/dataframe/test_dir_pytest.py index e81acd4..7f147a3 100644 --- a/eland/tests/dataframe/test_dir_pytest.py +++ b/tests/dataframe/test_dir_pytest.py @@ -18,7 +18,7 @@ # File called _pytest for PyCharm compatibility -from eland.tests.common import TestData +from tests.common import TestData class TestDataFrameDir(TestData): diff --git a/eland/tests/dataframe/test_drop_pytest.py b/tests/dataframe/test_drop_pytest.py similarity index 100% rename from eland/tests/dataframe/test_drop_pytest.py rename to tests/dataframe/test_drop_pytest.py diff --git a/eland/tests/dataframe/test_dtypes_pytest.py b/tests/dataframe/test_dtypes_pytest.py similarity index 98% rename from eland/tests/dataframe/test_dtypes_pytest.py rename to tests/dataframe/test_dtypes_pytest.py index 729d963..68be8d2 100644 --- a/eland/tests/dataframe/test_dtypes_pytest.py +++ b/tests/dataframe/test_dtypes_pytest.py @@ -20,7 +20,7 @@ import numpy as np import pandas as pd -from eland.tests.common import assert_series_equal +from tests.common import assert_series_equal class TestDataFrameDtypes: diff --git a/eland/tests/dataframe/test_es_match_pytest.py b/tests/dataframe/test_es_match_pytest.py similarity index 97% rename from eland/tests/dataframe/test_es_match_pytest.py rename to tests/dataframe/test_es_match_pytest.py index 67923df..8ca038b 100644 --- a/eland/tests/dataframe/test_es_match_pytest.py +++ b/tests/dataframe/test_es_match_pytest.py @@ -17,7 +17,7 @@ # File called _pytest for PyCharm compatability -from eland.tests.common import TestData +from tests.common import TestData class TestEsMatch(TestData): diff --git a/eland/tests/dataframe/test_es_query_pytest.py b/tests/dataframe/test_es_query_pytest.py similarity index 97% rename from eland/tests/dataframe/test_es_query_pytest.py rename to tests/dataframe/test_es_query_pytest.py index fe9429a..bfd9a6d 100644 --- a/eland/tests/dataframe/test_es_query_pytest.py +++ b/tests/dataframe/test_es_query_pytest.py @@ -19,7 +19,7 @@ import pytest -from eland.tests.common import TestData, assert_eland_frame_equal +from tests.common import TestData, assert_eland_frame_equal class TestDataEsQuery(TestData): diff --git a/eland/tests/dataframe/test_filter_pytest.py b/tests/dataframe/test_filter_pytest.py similarity index 98% rename from eland/tests/dataframe/test_filter_pytest.py rename to tests/dataframe/test_filter_pytest.py index 9fdc7a2..d00283e 100644 --- a/eland/tests/dataframe/test_filter_pytest.py +++ b/tests/dataframe/test_filter_pytest.py @@ -19,7 +19,7 @@ import pytest -from eland.tests.common import TestData +from tests.common import TestData class TestDataFrameFilter(TestData): diff --git a/eland/tests/dataframe/test_get_pytest.py b/tests/dataframe/test_get_pytest.py similarity index 100% rename from eland/tests/dataframe/test_get_pytest.py rename to tests/dataframe/test_get_pytest.py diff --git a/eland/tests/dataframe/test_getitem_pytest.py b/tests/dataframe/test_getitem_pytest.py similarity index 100% rename from eland/tests/dataframe/test_getitem_pytest.py rename to tests/dataframe/test_getitem_pytest.py diff --git a/eland/tests/dataframe/test_groupby_pytest.py b/tests/dataframe/test_groupby_pytest.py similarity index 97% rename from eland/tests/dataframe/test_groupby_pytest.py rename to tests/dataframe/test_groupby_pytest.py index dd0afad..9dda3c3 100644 --- a/eland/tests/dataframe/test_groupby_pytest.py +++ b/tests/dataframe/test_groupby_pytest.py @@ -1,196 +1,196 @@ -# Licensed to Elasticsearch B.V. under one or more contributor -# license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright -# ownership. Elasticsearch B.V. licenses this file to you under -# the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# File called _pytest for PyCharm compatability - -import pandas as pd -import pytest -from pandas.testing import assert_frame_equal, assert_index_equal, assert_series_equal - -from eland.tests.common import TestData - - -class TestGroupbyDataFrame(TestData): - funcs = ["max", "min", "mean", "sum"] - filter_data = [ - "AvgTicketPrice", - "Cancelled", - "dayOfWeek", - ] - - @pytest.mark.parametrize("numeric_only", [True]) - def test_groupby_aggregate(self, numeric_only): - # TODO Add tests for numeric_only=False for aggs - # when we support aggregations on text fields - pd_flights = self.pd_flights().filter(self.filter_data) - ed_flights = self.ed_flights().filter(self.filter_data) - - pd_groupby = pd_flights.groupby("Cancelled").agg( - self.funcs, numeric_only=numeric_only - ) - ed_groupby = ed_flights.groupby("Cancelled").agg( - self.funcs, numeric_only=numeric_only - ) - - # checking only values because dtypes are checked in aggs tests - assert_frame_equal(pd_groupby, ed_groupby, check_exact=False, check_dtype=False) - - @pytest.mark.parametrize("pd_agg", funcs) - def test_groupby_aggregate_single_aggs(self, pd_agg): - pd_flights = self.pd_flights().filter(self.filter_data) - ed_flights = self.ed_flights().filter(self.filter_data) - - pd_groupby = pd_flights.groupby("Cancelled").agg([pd_agg], numeric_only=True) - ed_groupby = ed_flights.groupby("Cancelled").agg([pd_agg], numeric_only=True) - - # checking only values because dtypes are checked in aggs tests - assert_frame_equal(pd_groupby, ed_groupby, check_exact=False, check_dtype=False) - - @pytest.mark.parametrize("pd_agg", ["max", "min", "mean", "sum", "median"]) - def test_groupby_aggs_numeric_only_true(self, pd_agg): - # Pandas has numeric_only applicable for the above aggs with groupby only. - - pd_flights = self.pd_flights().filter(self.filter_data) - ed_flights = self.ed_flights().filter(self.filter_data) - - pd_groupby = getattr(pd_flights.groupby("Cancelled"), pd_agg)(numeric_only=True) - ed_groupby = getattr(ed_flights.groupby("Cancelled"), pd_agg)(numeric_only=True) - - # checking only values because dtypes are checked in aggs tests - assert_frame_equal( - pd_groupby, ed_groupby, check_exact=False, check_dtype=False, rtol=2 - ) - - @pytest.mark.parametrize("pd_agg", ["mad", "var", "std"]) - def test_groupby_aggs_mad_var_std(self, pd_agg): - # For these aggs pandas doesn't support numeric_only - pd_flights = self.pd_flights().filter(self.filter_data) - ed_flights = self.ed_flights().filter(self.filter_data) - - pd_groupby = getattr(pd_flights.groupby("Cancelled"), pd_agg)() - ed_groupby = getattr(ed_flights.groupby("Cancelled"), pd_agg)(numeric_only=True) - - # checking only values because dtypes are checked in aggs tests - assert_frame_equal( - pd_groupby, ed_groupby, check_exact=False, check_dtype=False, rtol=4 - ) - - @pytest.mark.parametrize("pd_agg", ["nunique"]) - def test_groupby_aggs_nunique(self, pd_agg): - pd_flights = self.pd_flights().filter(self.filter_data) - ed_flights = self.ed_flights().filter(self.filter_data) - - pd_groupby = getattr(pd_flights.groupby("Cancelled"), pd_agg)() - ed_groupby = getattr(ed_flights.groupby("Cancelled"), pd_agg)() - - # checking only values because dtypes are checked in aggs tests - assert_frame_equal( - pd_groupby, ed_groupby, check_exact=False, check_dtype=False, rtol=4 - ) - - @pytest.mark.parametrize("pd_agg", ["max", "min", "mean", "median"]) - def test_groupby_aggs_numeric_only_false(self, pd_agg): - pd_flights = self.pd_flights().filter(self.filter_data + ["timestamp"]) - ed_flights = self.ed_flights().filter(self.filter_data + ["timestamp"]) - - # pandas numeric_only=False, matches with Eland numeric_only=None - pd_groupby = getattr(pd_flights.groupby("Cancelled"), pd_agg)( - numeric_only=False - ) - ed_groupby = getattr(ed_flights.groupby("Cancelled"), pd_agg)(numeric_only=None) - - # sum usually returns NaT for Eland, Nothing is returned from pandas - # we only check timestamp field here, because remaining cols are similar to numeric_only=True tests - # assert_frame_equal doesn't work well for timestamp fields (It converts into int) - # so we convert it into float - pd_timestamp = pd.to_numeric(pd_groupby["timestamp"], downcast="float") - ed_timestamp = pd.to_numeric(ed_groupby["timestamp"], downcast="float") - - assert_series_equal(pd_timestamp, ed_timestamp, check_exact=False, rtol=4) - - def test_groupby_columns(self): - # Check errors - ed_flights = self.ed_flights().filter(self.filter_data) - - match = "by parameter should be specified to groupby" - with pytest.raises(ValueError, match=match): - ed_flights.groupby(None).mean() - - by = ["ABC", "Cancelled"] - match = "Requested columns 'ABC' not in the DataFrame" - with pytest.raises(KeyError, match=match): - ed_flights.groupby(by).mean() - - @pytest.mark.parametrize( - "by", - ["timestamp", "dayOfWeek", "Carrier", "Cancelled", ["dayOfWeek", "Carrier"]], - ) - def test_groupby_different_dtypes(self, by): - columns = ["dayOfWeek", "Carrier", "timestamp", "Cancelled"] - pd_flights = self.pd_flights_small().filter(columns) - ed_flights = self.ed_flights_small().filter(columns) - - pd_groupby = pd_flights.groupby(by).nunique() - ed_groupby = ed_flights.groupby(by).nunique() - - assert list(pd_groupby.index) == list(ed_groupby.index) - assert pd_groupby.index.dtype == ed_groupby.index.dtype - assert list(pd_groupby.columns) == list(ed_groupby.columns) - - def test_groupby_dropna(self): - # TODO Add tests once dropna is implemeted - pass - - @pytest.mark.parametrize("groupby", ["dayOfWeek", ["dayOfWeek", "Cancelled"]]) - @pytest.mark.parametrize( - ["func", "func_args"], - [ - ("count", ()), - ("agg", ("count",)), - ("agg", (["count"],)), - ("agg", (["max", "count", "min"],)), - ], - ) - def test_groupby_dataframe_count(self, groupby, func, func_args): - pd_flights = self.pd_flights().filter(self.filter_data) - ed_flights = self.ed_flights().filter(self.filter_data) - - pd_count = getattr(pd_flights.groupby(groupby), func)(*func_args) - ed_count = getattr(ed_flights.groupby(groupby), func)(*func_args) - - assert_index_equal(pd_count.columns, ed_count.columns) - assert_index_equal(pd_count.index, ed_count.index) - assert_frame_equal(pd_count, ed_count) - assert_series_equal(pd_count.dtypes, ed_count.dtypes) - - def test_groupby_dataframe_mad(self): - pd_flights = self.pd_flights().filter(self.filter_data + ["DestCountry"]) - ed_flights = self.ed_flights().filter(self.filter_data + ["DestCountry"]) - - pd_mad = pd_flights.groupby("DestCountry").mad() - ed_mad = ed_flights.groupby("DestCountry").mad() - - assert_index_equal(pd_mad.columns, ed_mad.columns) - assert_index_equal(pd_mad.index, ed_mad.index) - assert_series_equal(pd_mad.dtypes, ed_mad.dtypes) - - pd_min_mad = pd_flights.groupby("DestCountry").aggregate(["min", "mad"]) - ed_min_mad = ed_flights.groupby("DestCountry").aggregate(["min", "mad"]) - - assert_index_equal(pd_min_mad.columns, ed_min_mad.columns) - assert_index_equal(pd_min_mad.index, ed_min_mad.index) - assert_series_equal(pd_min_mad.dtypes, ed_min_mad.dtypes) +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# File called _pytest for PyCharm compatability + +import pandas as pd +import pytest +from pandas.testing import assert_frame_equal, assert_index_equal, assert_series_equal + +from tests.common import TestData + + +class TestGroupbyDataFrame(TestData): + funcs = ["max", "min", "mean", "sum"] + filter_data = [ + "AvgTicketPrice", + "Cancelled", + "dayOfWeek", + ] + + @pytest.mark.parametrize("numeric_only", [True]) + def test_groupby_aggregate(self, numeric_only): + # TODO Add tests for numeric_only=False for aggs + # when we support aggregations on text fields + pd_flights = self.pd_flights().filter(self.filter_data) + ed_flights = self.ed_flights().filter(self.filter_data) + + pd_groupby = pd_flights.groupby("Cancelled").agg( + self.funcs, numeric_only=numeric_only + ) + ed_groupby = ed_flights.groupby("Cancelled").agg( + self.funcs, numeric_only=numeric_only + ) + + # checking only values because dtypes are checked in aggs tests + assert_frame_equal(pd_groupby, ed_groupby, check_exact=False, check_dtype=False) + + @pytest.mark.parametrize("pd_agg", funcs) + def test_groupby_aggregate_single_aggs(self, pd_agg): + pd_flights = self.pd_flights().filter(self.filter_data) + ed_flights = self.ed_flights().filter(self.filter_data) + + pd_groupby = pd_flights.groupby("Cancelled").agg([pd_agg], numeric_only=True) + ed_groupby = ed_flights.groupby("Cancelled").agg([pd_agg], numeric_only=True) + + # checking only values because dtypes are checked in aggs tests + assert_frame_equal(pd_groupby, ed_groupby, check_exact=False, check_dtype=False) + + @pytest.mark.parametrize("pd_agg", ["max", "min", "mean", "sum", "median"]) + def test_groupby_aggs_numeric_only_true(self, pd_agg): + # Pandas has numeric_only applicable for the above aggs with groupby only. + + pd_flights = self.pd_flights().filter(self.filter_data) + ed_flights = self.ed_flights().filter(self.filter_data) + + pd_groupby = getattr(pd_flights.groupby("Cancelled"), pd_agg)(numeric_only=True) + ed_groupby = getattr(ed_flights.groupby("Cancelled"), pd_agg)(numeric_only=True) + + # checking only values because dtypes are checked in aggs tests + assert_frame_equal( + pd_groupby, ed_groupby, check_exact=False, check_dtype=False, rtol=2 + ) + + @pytest.mark.parametrize("pd_agg", ["mad", "var", "std"]) + def test_groupby_aggs_mad_var_std(self, pd_agg): + # For these aggs pandas doesn't support numeric_only + pd_flights = self.pd_flights().filter(self.filter_data) + ed_flights = self.ed_flights().filter(self.filter_data) + + pd_groupby = getattr(pd_flights.groupby("Cancelled"), pd_agg)() + ed_groupby = getattr(ed_flights.groupby("Cancelled"), pd_agg)(numeric_only=True) + + # checking only values because dtypes are checked in aggs tests + assert_frame_equal( + pd_groupby, ed_groupby, check_exact=False, check_dtype=False, rtol=4 + ) + + @pytest.mark.parametrize("pd_agg", ["nunique"]) + def test_groupby_aggs_nunique(self, pd_agg): + pd_flights = self.pd_flights().filter(self.filter_data) + ed_flights = self.ed_flights().filter(self.filter_data) + + pd_groupby = getattr(pd_flights.groupby("Cancelled"), pd_agg)() + ed_groupby = getattr(ed_flights.groupby("Cancelled"), pd_agg)() + + # checking only values because dtypes are checked in aggs tests + assert_frame_equal( + pd_groupby, ed_groupby, check_exact=False, check_dtype=False, rtol=4 + ) + + @pytest.mark.parametrize("pd_agg", ["max", "min", "mean", "median"]) + def test_groupby_aggs_numeric_only_false(self, pd_agg): + pd_flights = self.pd_flights().filter(self.filter_data + ["timestamp"]) + ed_flights = self.ed_flights().filter(self.filter_data + ["timestamp"]) + + # pandas numeric_only=False, matches with Eland numeric_only=None + pd_groupby = getattr(pd_flights.groupby("Cancelled"), pd_agg)( + numeric_only=False + ) + ed_groupby = getattr(ed_flights.groupby("Cancelled"), pd_agg)(numeric_only=None) + + # sum usually returns NaT for Eland, Nothing is returned from pandas + # we only check timestamp field here, because remaining cols are similar to numeric_only=True tests + # assert_frame_equal doesn't work well for timestamp fields (It converts into int) + # so we convert it into float + pd_timestamp = pd.to_numeric(pd_groupby["timestamp"], downcast="float") + ed_timestamp = pd.to_numeric(ed_groupby["timestamp"], downcast="float") + + assert_series_equal(pd_timestamp, ed_timestamp, check_exact=False, rtol=4) + + def test_groupby_columns(self): + # Check errors + ed_flights = self.ed_flights().filter(self.filter_data) + + match = "by parameter should be specified to groupby" + with pytest.raises(ValueError, match=match): + ed_flights.groupby(None).mean() + + by = ["ABC", "Cancelled"] + match = "Requested columns 'ABC' not in the DataFrame" + with pytest.raises(KeyError, match=match): + ed_flights.groupby(by).mean() + + @pytest.mark.parametrize( + "by", + ["timestamp", "dayOfWeek", "Carrier", "Cancelled", ["dayOfWeek", "Carrier"]], + ) + def test_groupby_different_dtypes(self, by): + columns = ["dayOfWeek", "Carrier", "timestamp", "Cancelled"] + pd_flights = self.pd_flights_small().filter(columns) + ed_flights = self.ed_flights_small().filter(columns) + + pd_groupby = pd_flights.groupby(by).nunique() + ed_groupby = ed_flights.groupby(by).nunique() + + assert list(pd_groupby.index) == list(ed_groupby.index) + assert pd_groupby.index.dtype == ed_groupby.index.dtype + assert list(pd_groupby.columns) == list(ed_groupby.columns) + + def test_groupby_dropna(self): + # TODO Add tests once dropna is implemeted + pass + + @pytest.mark.parametrize("groupby", ["dayOfWeek", ["dayOfWeek", "Cancelled"]]) + @pytest.mark.parametrize( + ["func", "func_args"], + [ + ("count", ()), + ("agg", ("count",)), + ("agg", (["count"],)), + ("agg", (["max", "count", "min"],)), + ], + ) + def test_groupby_dataframe_count(self, groupby, func, func_args): + pd_flights = self.pd_flights().filter(self.filter_data) + ed_flights = self.ed_flights().filter(self.filter_data) + + pd_count = getattr(pd_flights.groupby(groupby), func)(*func_args) + ed_count = getattr(ed_flights.groupby(groupby), func)(*func_args) + + assert_index_equal(pd_count.columns, ed_count.columns) + assert_index_equal(pd_count.index, ed_count.index) + assert_frame_equal(pd_count, ed_count) + assert_series_equal(pd_count.dtypes, ed_count.dtypes) + + def test_groupby_dataframe_mad(self): + pd_flights = self.pd_flights().filter(self.filter_data + ["DestCountry"]) + ed_flights = self.ed_flights().filter(self.filter_data + ["DestCountry"]) + + pd_mad = pd_flights.groupby("DestCountry").mad() + ed_mad = ed_flights.groupby("DestCountry").mad() + + assert_index_equal(pd_mad.columns, ed_mad.columns) + assert_index_equal(pd_mad.index, ed_mad.index) + assert_series_equal(pd_mad.dtypes, ed_mad.dtypes) + + pd_min_mad = pd_flights.groupby("DestCountry").aggregate(["min", "mad"]) + ed_min_mad = ed_flights.groupby("DestCountry").aggregate(["min", "mad"]) + + assert_index_equal(pd_min_mad.columns, ed_min_mad.columns) + assert_index_equal(pd_min_mad.index, ed_min_mad.index) + assert_series_equal(pd_min_mad.dtypes, ed_min_mad.dtypes) diff --git a/eland/tests/dataframe/test_head_tail_pytest.py b/tests/dataframe/test_head_tail_pytest.py similarity index 98% rename from eland/tests/dataframe/test_head_tail_pytest.py rename to tests/dataframe/test_head_tail_pytest.py index ec1f0a4..2f4a702 100644 --- a/eland/tests/dataframe/test_head_tail_pytest.py +++ b/tests/dataframe/test_head_tail_pytest.py @@ -17,7 +17,7 @@ # File called _pytest for PyCharm compatability -from eland.tests.common import TestData, assert_pandas_eland_frame_equal +from tests.common import TestData, assert_pandas_eland_frame_equal class TestDataFrameHeadTail(TestData): diff --git a/eland/tests/dataframe/test_hist_pytest.py b/tests/dataframe/test_hist_pytest.py similarity index 98% rename from eland/tests/dataframe/test_hist_pytest.py rename to tests/dataframe/test_hist_pytest.py index 5a92568..22a5b0e 100644 --- a/eland/tests/dataframe/test_hist_pytest.py +++ b/tests/dataframe/test_hist_pytest.py @@ -21,7 +21,7 @@ import numpy as np import pandas as pd from pandas.testing import assert_frame_equal -from eland.tests.common import TestData +from tests.common import TestData class TestDataFrameHist(TestData): diff --git a/eland/tests/dataframe/test_info_pytest.py b/tests/dataframe/test_info_pytest.py similarity index 96% rename from eland/tests/dataframe/test_info_pytest.py rename to tests/dataframe/test_info_pytest.py index 6b38a0a..fbc65d5 100644 --- a/eland/tests/dataframe/test_info_pytest.py +++ b/tests/dataframe/test_info_pytest.py @@ -19,8 +19,8 @@ from io import StringIO import eland as ed -from eland.tests import ES_TEST_CLIENT -from eland.tests.common import TestData +from tests import ES_TEST_CLIENT +from tests.common import TestData class TestDataFrameInfo(TestData): diff --git a/eland/tests/dataframe/test_init_pytest.py b/tests/dataframe/test_init_pytest.py similarity index 96% rename from eland/tests/dataframe/test_init_pytest.py rename to tests/dataframe/test_init_pytest.py index e33dd6b..29ca333 100644 --- a/eland/tests/dataframe/test_init_pytest.py +++ b/tests/dataframe/test_init_pytest.py @@ -21,7 +21,7 @@ import pytest import eland as ed from eland.query_compiler import QueryCompiler -from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME +from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME class TestDataFrameInit: diff --git a/eland/tests/dataframe/test_keys_pytest.py b/tests/dataframe/test_keys_pytest.py similarity index 97% rename from eland/tests/dataframe/test_keys_pytest.py rename to tests/dataframe/test_keys_pytest.py index 4bb4566..187f72f 100644 --- a/eland/tests/dataframe/test_keys_pytest.py +++ b/tests/dataframe/test_keys_pytest.py @@ -19,7 +19,7 @@ from pandas.testing import assert_index_equal -from eland.tests.common import TestData +from tests.common import TestData class TestDataFrameKeys(TestData): diff --git a/eland/tests/dataframe/test_metrics_pytest.py b/tests/dataframe/test_metrics_pytest.py similarity index 99% rename from eland/tests/dataframe/test_metrics_pytest.py rename to tests/dataframe/test_metrics_pytest.py index 6eba69d..8542009 100644 --- a/eland/tests/dataframe/test_metrics_pytest.py +++ b/tests/dataframe/test_metrics_pytest.py @@ -22,7 +22,7 @@ import pandas as pd import pytest from pandas.testing import assert_frame_equal, assert_series_equal -from eland.tests.common import TestData +from tests.common import TestData class TestDataFrameMetrics(TestData): diff --git a/eland/tests/dataframe/test_nunique_pytest.py b/tests/dataframe/test_nunique_pytest.py similarity index 97% rename from eland/tests/dataframe/test_nunique_pytest.py rename to tests/dataframe/test_nunique_pytest.py index 40438b2..8379920 100644 --- a/eland/tests/dataframe/test_nunique_pytest.py +++ b/tests/dataframe/test_nunique_pytest.py @@ -19,7 +19,7 @@ from pandas.testing import assert_series_equal -from eland.tests.common import TestData +from tests.common import TestData class TestDataFrameNUnique(TestData): diff --git a/eland/tests/dataframe/test_query_pytest.py b/tests/dataframe/test_query_pytest.py similarity index 98% rename from eland/tests/dataframe/test_query_pytest.py rename to tests/dataframe/test_query_pytest.py index 321f351..7269295 100644 --- a/eland/tests/dataframe/test_query_pytest.py +++ b/tests/dataframe/test_query_pytest.py @@ -20,7 +20,7 @@ import pandas as pd import eland as ed -from eland.tests.common import ES_TEST_CLIENT, TestData, assert_pandas_eland_frame_equal +from tests.common import ES_TEST_CLIENT, TestData, assert_pandas_eland_frame_equal class TestDataFrameQuery(TestData): diff --git a/eland/tests/dataframe/test_repr_pytest.py b/tests/dataframe/test_repr_pytest.py similarity index 98% rename from eland/tests/dataframe/test_repr_pytest.py rename to tests/dataframe/test_repr_pytest.py index 12bca5a..82eb720 100644 --- a/eland/tests/dataframe/test_repr_pytest.py +++ b/tests/dataframe/test_repr_pytest.py @@ -21,7 +21,7 @@ import pandas as pd import pytest from eland.dataframe import DEFAULT_NUM_ROWS_DISPLAYED -from eland.tests.common import TestData, assert_pandas_eland_series_equal +from tests.common import TestData, assert_pandas_eland_series_equal class TestDataFrameRepr(TestData): @@ -161,6 +161,9 @@ class TestDataFrameRepr(TestData): ed_ecom_r = repr(ed_ecom[ed_ecom["currency"] == "USD"]) pd_ecom_r = repr(pd_ecom[pd_ecom["currency"] == "USD"]) + print(ed_ecom_r) + print(pd_ecom_r) + assert ed_ecom_r == pd_ecom_r """ diff --git a/eland/tests/dataframe/test_sample_pytest.py b/tests/dataframe/test_sample_pytest.py similarity index 98% rename from eland/tests/dataframe/test_sample_pytest.py rename to tests/dataframe/test_sample_pytest.py index 3345126..e473010 100644 --- a/eland/tests/dataframe/test_sample_pytest.py +++ b/tests/dataframe/test_sample_pytest.py @@ -20,7 +20,7 @@ import pytest from pandas.testing import assert_frame_equal from eland import eland_to_pandas -from eland.tests.common import TestData +from tests.common import TestData class TestDataFrameSample(TestData): diff --git a/eland/tests/dataframe/test_select_dtypes_pytest.py b/tests/dataframe/test_select_dtypes_pytest.py similarity index 95% rename from eland/tests/dataframe/test_select_dtypes_pytest.py rename to tests/dataframe/test_select_dtypes_pytest.py index 738bf3b..497b088 100644 --- a/eland/tests/dataframe/test_select_dtypes_pytest.py +++ b/tests/dataframe/test_select_dtypes_pytest.py @@ -18,7 +18,7 @@ # File called _pytest for PyCharm compatability import numpy as np -from eland.tests.common import TestData, assert_pandas_eland_frame_equal +from tests.common import TestData, assert_pandas_eland_frame_equal class TestDataFrameSelectDTypes(TestData): diff --git a/eland/tests/dataframe/test_shape_pytest.py b/tests/dataframe/test_shape_pytest.py similarity index 97% rename from eland/tests/dataframe/test_shape_pytest.py rename to tests/dataframe/test_shape_pytest.py index 202f281..7f16e66 100644 --- a/eland/tests/dataframe/test_shape_pytest.py +++ b/tests/dataframe/test_shape_pytest.py @@ -17,7 +17,7 @@ # File called _pytest for PyCharm compatability -from eland.tests.common import TestData +from tests.common import TestData class TestDataFrameShape(TestData): diff --git a/eland/tests/dataframe/test_to_csv_pytest.py b/tests/dataframe/test_to_csv_pytest.py similarity index 97% rename from eland/tests/dataframe/test_to_csv_pytest.py rename to tests/dataframe/test_to_csv_pytest.py index bb9560f..fcc454e 100644 --- a/eland/tests/dataframe/test_to_csv_pytest.py +++ b/tests/dataframe/test_to_csv_pytest.py @@ -24,8 +24,8 @@ import pandas as pd from pandas.testing import assert_frame_equal import eland as ed -from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME -from eland.tests.common import ROOT_DIR, TestData +from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME +from tests.common import ROOT_DIR, TestData class TestDataFrameToCSV(TestData): diff --git a/eland/tests/dataframe/test_utils_pytest.py b/tests/dataframe/test_utils_pytest.py similarity index 97% rename from eland/tests/dataframe/test_utils_pytest.py rename to tests/dataframe/test_utils_pytest.py index 6dfcc22..d76333c 100644 --- a/eland/tests/dataframe/test_utils_pytest.py +++ b/tests/dataframe/test_utils_pytest.py @@ -23,7 +23,7 @@ import pytest import eland as ed from eland.field_mappings import FieldMappings -from eland.tests.common import ES_TEST_CLIENT, TestData, assert_pandas_eland_frame_equal +from tests.common import ES_TEST_CLIENT, TestData, assert_pandas_eland_frame_equal class TestDataFrameUtils(TestData): @@ -137,7 +137,7 @@ class TestDataFrameUtils(TestData): ES_TEST_CLIENT.indices.delete(index=index_name) - def test_eland_to_pandas_performance(self): + def tests_to_pandas_performance(self): # TODO quantify this ed.eland_to_pandas(self.ed_flights(), show_progress=True) diff --git a/eland/tests/ecommerce.json.gz b/tests/ecommerce.json.gz similarity index 100% rename from eland/tests/ecommerce.json.gz rename to tests/ecommerce.json.gz diff --git a/eland/tests/ecommerce_df.json.gz b/tests/ecommerce_df.json.gz similarity index 100% rename from eland/tests/ecommerce_df.json.gz rename to tests/ecommerce_df.json.gz diff --git a/eland/tests/etl/__init__.py b/tests/etl/__init__.py similarity index 100% rename from eland/tests/etl/__init__.py rename to tests/etl/__init__.py diff --git a/eland/tests/etl/test_pandas_to_eland.py b/tests/etl/test_pandas_to_eland.py similarity index 99% rename from eland/tests/etl/test_pandas_to_eland.py rename to tests/etl/test_pandas_to_eland.py index 7f8596e..c99f57c 100644 --- a/eland/tests/etl/test_pandas_to_eland.py +++ b/tests/etl/test_pandas_to_eland.py @@ -22,7 +22,7 @@ import pytest from elasticsearch.helpers import BulkIndexError from eland import DataFrame, pandas_to_eland -from eland.tests.common import ( +from tests.common import ( ES_TEST_CLIENT, assert_frame_equal, assert_pandas_eland_frame_equal, diff --git a/eland/tests/field_mappings/__init__.py b/tests/field_mappings/__init__.py similarity index 100% rename from eland/tests/field_mappings/__init__.py rename to tests/field_mappings/__init__.py diff --git a/eland/tests/field_mappings/test_aggregatables_pytest.py b/tests/field_mappings/test_aggregatables_pytest.py similarity index 98% rename from eland/tests/field_mappings/test_aggregatables_pytest.py rename to tests/field_mappings/test_aggregatables_pytest.py index c6af0a3..9cd1fa8 100644 --- a/eland/tests/field_mappings/test_aggregatables_pytest.py +++ b/tests/field_mappings/test_aggregatables_pytest.py @@ -19,8 +19,8 @@ import pytest from eland.field_mappings import FieldMappings -from eland.tests import ECOMMERCE_INDEX_NAME, ES_TEST_CLIENT -from eland.tests.common import TestData +from tests import ECOMMERCE_INDEX_NAME, ES_TEST_CLIENT +from tests.common import TestData class TestAggregatables(TestData): diff --git a/eland/tests/field_mappings/test_datetime_pytest.py b/tests/field_mappings/test_datetime_pytest.py similarity index 99% rename from eland/tests/field_mappings/test_datetime_pytest.py rename to tests/field_mappings/test_datetime_pytest.py index 447381e..77364dc 100644 --- a/eland/tests/field_mappings/test_datetime_pytest.py +++ b/tests/field_mappings/test_datetime_pytest.py @@ -19,7 +19,7 @@ from datetime import datetime from eland.field_mappings import FieldMappings -from eland.tests.common import ES_TEST_CLIENT, TestData +from tests.common import ES_TEST_CLIENT, TestData class TestDateTime(TestData): diff --git a/eland/tests/field_mappings/test_display_names_pytest.py b/tests/field_mappings/test_display_names_pytest.py similarity index 97% rename from eland/tests/field_mappings/test_display_names_pytest.py rename to tests/field_mappings/test_display_names_pytest.py index f5068f6..9d8d558 100644 --- a/eland/tests/field_mappings/test_display_names_pytest.py +++ b/tests/field_mappings/test_display_names_pytest.py @@ -19,8 +19,8 @@ import pytest from eland.field_mappings import FieldMappings -from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME -from eland.tests.common import TestData +from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME +from tests.common import TestData class TestDisplayNames(TestData): diff --git a/eland/tests/field_mappings/test_dtypes_pytest.py b/tests/field_mappings/test_dtypes_pytest.py similarity index 94% rename from eland/tests/field_mappings/test_dtypes_pytest.py rename to tests/field_mappings/test_dtypes_pytest.py index 41da0fc..ea15e2a 100644 --- a/eland/tests/field_mappings/test_dtypes_pytest.py +++ b/tests/field_mappings/test_dtypes_pytest.py @@ -19,8 +19,8 @@ from pandas.testing import assert_series_equal from eland.field_mappings import FieldMappings -from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME -from eland.tests.common import TestData +from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME +from tests.common import TestData class TestDTypes(TestData): diff --git a/eland/tests/field_mappings/test_field_name_pd_dtype_pytest.py b/tests/field_mappings/test_field_name_pd_dtype_pytest.py similarity index 93% rename from eland/tests/field_mappings/test_field_name_pd_dtype_pytest.py rename to tests/field_mappings/test_field_name_pd_dtype_pytest.py index 94efe2c..4c2f8c5 100644 --- a/eland/tests/field_mappings/test_field_name_pd_dtype_pytest.py +++ b/tests/field_mappings/test_field_name_pd_dtype_pytest.py @@ -20,8 +20,8 @@ import pytest from pandas.testing import assert_series_equal from eland.field_mappings import FieldMappings -from eland.tests import FLIGHTS_INDEX_NAME, FLIGHTS_MAPPING -from eland.tests.common import ES_TEST_CLIENT, TestData +from tests import FLIGHTS_INDEX_NAME, FLIGHTS_MAPPING +from tests.common import ES_TEST_CLIENT, TestData class TestFieldNamePDDType(TestData): diff --git a/eland/tests/field_mappings/test_get_field_names_pytest.py b/tests/field_mappings/test_get_field_names_pytest.py similarity index 96% rename from eland/tests/field_mappings/test_get_field_names_pytest.py rename to tests/field_mappings/test_get_field_names_pytest.py index 59bdd38..20af77b 100644 --- a/eland/tests/field_mappings/test_get_field_names_pytest.py +++ b/tests/field_mappings/test_get_field_names_pytest.py @@ -21,8 +21,8 @@ from pandas.testing import assert_index_equal # File called _pytest for PyCharm compatability from eland.field_mappings import FieldMappings -from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME -from eland.tests.common import TestData +from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME +from tests.common import TestData class TestGetFieldNames(TestData): diff --git a/eland/tests/field_mappings/test_mappings_with_type_pytest.py b/tests/field_mappings/test_mappings_with_type_pytest.py similarity index 98% rename from eland/tests/field_mappings/test_mappings_with_type_pytest.py rename to tests/field_mappings/test_mappings_with_type_pytest.py index b49d58c..7572b56 100644 --- a/eland/tests/field_mappings/test_mappings_with_type_pytest.py +++ b/tests/field_mappings/test_mappings_with_type_pytest.py @@ -19,7 +19,7 @@ import pytest from eland.field_mappings import FieldMappings -from eland.tests.common import TestData +from tests.common import TestData class TestMappingsWithType(TestData): diff --git a/eland/tests/field_mappings/test_metric_source_fields_pytest.py b/tests/field_mappings/test_metric_source_fields_pytest.py similarity index 98% rename from eland/tests/field_mappings/test_metric_source_fields_pytest.py rename to tests/field_mappings/test_metric_source_fields_pytest.py index 9c4e2c9..8951079 100644 --- a/eland/tests/field_mappings/test_metric_source_fields_pytest.py +++ b/tests/field_mappings/test_metric_source_fields_pytest.py @@ -20,8 +20,8 @@ import numpy as np from eland.field_mappings import FieldMappings -from eland.tests import ECOMMERCE_INDEX_NAME, ES_TEST_CLIENT, FLIGHTS_INDEX_NAME -from eland.tests.common import TestData +from tests import ECOMMERCE_INDEX_NAME, ES_TEST_CLIENT, FLIGHTS_INDEX_NAME +from tests.common import TestData class TestMetricSourceFields(TestData): diff --git a/eland/tests/field_mappings/test_rename_pytest.py b/tests/field_mappings/test_rename_pytest.py similarity index 97% rename from eland/tests/field_mappings/test_rename_pytest.py rename to tests/field_mappings/test_rename_pytest.py index 2775a6c..4afa75d 100644 --- a/eland/tests/field_mappings/test_rename_pytest.py +++ b/tests/field_mappings/test_rename_pytest.py @@ -18,8 +18,8 @@ # File called _pytest for PyCharm compatability from eland.field_mappings import FieldMappings -from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME -from eland.tests.common import TestData +from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME +from tests.common import TestData class TestRename(TestData): diff --git a/eland/tests/field_mappings/test_scripted_fields_pytest.py b/tests/field_mappings/test_scripted_fields_pytest.py similarity index 95% rename from eland/tests/field_mappings/test_scripted_fields_pytest.py rename to tests/field_mappings/test_scripted_fields_pytest.py index 0e3d4f9..765f07c 100644 --- a/eland/tests/field_mappings/test_scripted_fields_pytest.py +++ b/tests/field_mappings/test_scripted_fields_pytest.py @@ -21,8 +21,8 @@ from io import StringIO import numpy as np from eland.field_mappings import FieldMappings -from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME -from eland.tests.common import TestData +from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME +from tests.common import TestData class TestScriptedFields(TestData): diff --git a/eland/tests/flights.json.gz b/tests/flights.json.gz similarity index 100% rename from eland/tests/flights.json.gz rename to tests/flights.json.gz diff --git a/eland/tests/flights_df.json.gz b/tests/flights_df.json.gz similarity index 100% rename from eland/tests/flights_df.json.gz rename to tests/flights_df.json.gz diff --git a/eland/tests/flights_small.json.gz b/tests/flights_small.json.gz similarity index 100% rename from eland/tests/flights_small.json.gz rename to tests/flights_small.json.gz diff --git a/eland/tests/ml/test_imported_ml_model_pytest.py b/tests/ml/test_imported_ml_model_pytest.py similarity index 99% rename from eland/tests/ml/test_imported_ml_model_pytest.py rename to tests/ml/test_imported_ml_model_pytest.py index 9e8445d..24e5d9b 100644 --- a/eland/tests/ml/test_imported_ml_model_pytest.py +++ b/tests/ml/test_imported_ml_model_pytest.py @@ -19,7 +19,7 @@ import numpy as np import pytest from eland.ml import MLModel -from eland.tests import ES_TEST_CLIENT, ES_VERSION +from tests import ES_TEST_CLIENT, ES_VERSION try: from sklearn import datasets diff --git a/eland/tests/ml/test_optional_dependency_pytest.py b/tests/ml/test_optional_dependency_pytest.py similarity index 100% rename from eland/tests/ml/test_optional_dependency_pytest.py rename to tests/ml/test_optional_dependency_pytest.py diff --git a/eland/tests/operators/__init__.py b/tests/notebook/__init__.py similarity index 100% rename from eland/tests/operators/__init__.py rename to tests/notebook/__init__.py diff --git a/eland/tests/tests_notebook/test_churn.csv b/tests/notebook/test_churn.csv similarity index 99% rename from eland/tests/tests_notebook/test_churn.csv rename to tests/notebook/test_churn.csv index 63d5fa3..f2d574b 100644 --- a/eland/tests/tests_notebook/test_churn.csv +++ b/tests/notebook/test_churn.csv @@ -1,3 +1,3 @@ -,state,account length,area code,phone number,international plan,voice mail plan,number vmail messages,total day minutes,total day calls,total day charge,total eve minutes,total eve calls,total eve charge,total night minutes,total night calls,total night charge,total intl minutes,total intl calls,total intl charge,customer service calls,churn -0,KS,128,415,382-4657,no,yes,25,265.1,110,45.07,197.4,99,16.78,244.7,91,11.01,10.0,3,2.7,1,0 +,state,account length,area code,phone number,international plan,voice mail plan,number vmail messages,total day minutes,total day calls,total day charge,total eve minutes,total eve calls,total eve charge,total night minutes,total night calls,total night charge,total intl minutes,total intl calls,total intl charge,customer service calls,churn +0,KS,128,415,382-4657,no,yes,25,265.1,110,45.07,197.4,99,16.78,244.7,91,11.01,10.0,3,2.7,1,0 1,OH,107,415,371-7191,no,yes,26,161.6,123,27.47,195.5,103,16.62,254.4,103,11.45,13.7,3,3.7,1,0 \ No newline at end of file diff --git a/eland/tests/tests_notebook/test_demo_notebook.ipynb b/tests/notebook/test_demo_notebook.ipynb similarity index 100% rename from eland/tests/tests_notebook/test_demo_notebook.ipynb rename to tests/notebook/test_demo_notebook.ipynb diff --git a/eland/tests/tests_notebook/test_etl.ipynb b/tests/notebook/test_etl.ipynb similarity index 93% rename from eland/tests/tests_notebook/test_etl.ipynb rename to tests/notebook/test_etl.ipynb index 26ca294..2c741e7 100644 --- a/eland/tests/tests_notebook/test_etl.ipynb +++ b/tests/notebook/test_etl.ipynb @@ -42,8 +42,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "2020-10-26 12:19:00.259395: read 10000 rows\n", - "2020-10-26 12:19:00.948930: read 13059 rows\n" + "2020-10-28 22:01:46.397163: read 10000 rows\n", + "2020-10-28 22:01:47.100938: read 13059 rows\n" ] } ], @@ -77,6 +77,27 @@ "execution_count": 5, "metadata": {}, "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "3e3e6e7371be43aabd4f9a2bb62ed737", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox(children=(HTML(value='Progress'), FloatProgress(value=0.0, max=2.0), HTML(value='')))" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, { "data": { "text/html": [ @@ -205,6 +226,7 @@ } ], "source": [ + "# NBVAL_IGNORE_OUTPUT\n", "ed.csv_to_eland(\"./test_churn.csv\", es_client='localhost', es_dest_index='churn', es_refresh=True, index_col=0)" ] }, diff --git a/eland/tests/tests_notebook/test_metrics.ipynb b/tests/notebook/test_metrics.ipynb similarity index 100% rename from eland/tests/tests_notebook/test_metrics.ipynb rename to tests/notebook/test_metrics.ipynb diff --git a/eland/tests/tests_notebook/test_plotting.ipynb b/tests/notebook/test_plotting.ipynb similarity index 100% rename from eland/tests/tests_notebook/test_plotting.ipynb rename to tests/notebook/test_plotting.ipynb diff --git a/eland/tests/operations/test_map_pd_aggs_to_es_aggs_pytest.py b/tests/operations/test_map_pd_aggs_to_es_aggs_pytest.py similarity index 100% rename from eland/tests/operations/test_map_pd_aggs_to_es_aggs_pytest.py rename to tests/operations/test_map_pd_aggs_to_es_aggs_pytest.py diff --git a/eland/tests/series/__init__.py b/tests/operators/__init__.py similarity index 100% rename from eland/tests/series/__init__.py rename to tests/operators/__init__.py diff --git a/eland/tests/operators/test_operators_pytest.py b/tests/operators/test_operators_pytest.py similarity index 100% rename from eland/tests/operators/test_operators_pytest.py rename to tests/operators/test_operators_pytest.py diff --git a/eland/tests/plotting/test_dataframe_hist_pytest.py b/tests/plotting/test_dataframe_hist_pytest.py similarity index 98% rename from eland/tests/plotting/test_dataframe_hist_pytest.py rename to tests/plotting/test_dataframe_hist_pytest.py index edd9cbd..1e782fe 100644 --- a/eland/tests/plotting/test_dataframe_hist_pytest.py +++ b/tests/plotting/test_dataframe_hist_pytest.py @@ -20,7 +20,7 @@ import pytest from matplotlib.testing.decorators import check_figures_equal -from eland.tests.common import TestData +from tests.common import TestData @check_figures_equal(extensions=["png"]) diff --git a/eland/tests/plotting/test_series_hist_pytest.py b/tests/plotting/test_series_hist_pytest.py similarity index 98% rename from eland/tests/plotting/test_series_hist_pytest.py rename to tests/plotting/test_series_hist_pytest.py index 67d117a..6c96869 100644 --- a/eland/tests/plotting/test_series_hist_pytest.py +++ b/tests/plotting/test_series_hist_pytest.py @@ -18,7 +18,7 @@ # File called _pytest for PyCharm compatability from matplotlib.testing.decorators import check_figures_equal -from eland.tests.common import TestData +from tests.common import TestData @check_figures_equal(extensions=["png"]) diff --git a/eland/tests/query/test_count_pytest.py b/tests/query/test_count_pytest.py similarity index 96% rename from eland/tests/query/test_count_pytest.py rename to tests/query/test_count_pytest.py index 2b7879b..f8c753d 100644 --- a/eland/tests/query/test_count_pytest.py +++ b/tests/query/test_count_pytest.py @@ -18,7 +18,7 @@ # File called _pytest for PyCharm compatability from eland.query import Query -from eland.tests.common import TestData +from tests.common import TestData class TestQueryCopy(TestData): diff --git a/eland/tests/query_compiler/test_es_match_pytest.py b/tests/query_compiler/test_es_match_pytest.py similarity index 99% rename from eland/tests/query_compiler/test_es_match_pytest.py rename to tests/query_compiler/test_es_match_pytest.py index f0625d7..ee1c1ba 100644 --- a/eland/tests/query_compiler/test_es_match_pytest.py +++ b/tests/query_compiler/test_es_match_pytest.py @@ -20,7 +20,7 @@ import pytest from eland.query_compiler import QueryCompiler -from eland.tests.common import TestData +from tests.common import TestData class TestEsMatch(TestData): diff --git a/eland/tests/query_compiler/test_get_field_names_pytest.py b/tests/query_compiler/test_get_field_names_pytest.py similarity index 97% rename from eland/tests/query_compiler/test_get_field_names_pytest.py rename to tests/query_compiler/test_get_field_names_pytest.py index ffbcb47..e9cc469 100644 --- a/eland/tests/query_compiler/test_get_field_names_pytest.py +++ b/tests/query_compiler/test_get_field_names_pytest.py @@ -19,7 +19,7 @@ import pandas as pd from pandas.testing import assert_index_equal -from eland.tests.common import TestData +from tests.common import TestData class TestGetFieldNames(TestData): diff --git a/eland/tests/tests_notebook/__init__.py b/tests/series/__init__.py similarity index 100% rename from eland/tests/tests_notebook/__init__.py rename to tests/series/__init__.py diff --git a/eland/tests/series/test_arithmetics_pytest.py b/tests/series/test_arithmetics_pytest.py similarity index 99% rename from eland/tests/series/test_arithmetics_pytest.py rename to tests/series/test_arithmetics_pytest.py index 218dc75..1942a61 100644 --- a/eland/tests/series/test_arithmetics_pytest.py +++ b/tests/series/test_arithmetics_pytest.py @@ -19,7 +19,7 @@ import numpy as np import pytest -from eland.tests.common import TestData, assert_pandas_eland_series_equal +from tests.common import TestData, assert_pandas_eland_series_equal class TestSeriesArithmetics(TestData): diff --git a/eland/tests/series/test_describe_pytest.py b/tests/series/test_describe_pytest.py similarity index 96% rename from eland/tests/series/test_describe_pytest.py rename to tests/series/test_describe_pytest.py index 2f255eb..7027cc5 100644 --- a/eland/tests/series/test_describe_pytest.py +++ b/tests/series/test_describe_pytest.py @@ -17,7 +17,7 @@ import pandas as pd -from eland.tests.common import TestData, assert_series_equal +from tests.common import TestData, assert_series_equal class TestSeriesDescribe(TestData): diff --git a/eland/tests/series/test_dtype_pytest.py b/tests/series/test_dtype_pytest.py similarity index 96% rename from eland/tests/series/test_dtype_pytest.py rename to tests/series/test_dtype_pytest.py index 4c45531..fd5566f 100644 --- a/eland/tests/series/test_dtype_pytest.py +++ b/tests/series/test_dtype_pytest.py @@ -21,7 +21,7 @@ import numpy as np import pandas as pd from eland.common import EMPTY_SERIES_DTYPE, build_pd_series -from eland.tests.common import assert_series_equal +from tests.common import assert_series_equal def test_empty_series_dtypes(): diff --git a/eland/tests/series/test_es_match.py b/tests/series/test_es_match.py similarity index 97% rename from eland/tests/series/test_es_match.py rename to tests/series/test_es_match.py index d29b1a1..86395d8 100644 --- a/eland/tests/series/test_es_match.py +++ b/tests/series/test_es_match.py @@ -17,7 +17,7 @@ # File called _pytest for PyCharm compatability -from eland.tests.common import TestData +from tests.common import TestData class TestEsMatch(TestData): diff --git a/eland/tests/series/test_filter_pytest.py b/tests/series/test_filter_pytest.py similarity index 97% rename from eland/tests/series/test_filter_pytest.py rename to tests/series/test_filter_pytest.py index 9da03c7..948f6d0 100644 --- a/eland/tests/series/test_filter_pytest.py +++ b/tests/series/test_filter_pytest.py @@ -19,7 +19,7 @@ import pytest -from eland.tests.common import TestData, assert_pandas_eland_series_equal +from tests.common import TestData, assert_pandas_eland_series_equal class TestSeriesFilter(TestData): diff --git a/eland/tests/series/test_head_tail_pytest.py b/tests/series/test_head_tail_pytest.py similarity index 90% rename from eland/tests/series/test_head_tail_pytest.py rename to tests/series/test_head_tail_pytest.py index 93c1d3f..925ffa0 100644 --- a/eland/tests/series/test_head_tail_pytest.py +++ b/tests/series/test_head_tail_pytest.py @@ -17,8 +17,8 @@ # File called _pytest for PyCharm compatability import eland as ed -from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME -from eland.tests.common import TestData, assert_pandas_eland_series_equal +from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME +from tests.common import TestData, assert_pandas_eland_series_equal class TestSeriesHeadTail(TestData): diff --git a/eland/tests/series/test_hist_pytest.py b/tests/series/test_hist_pytest.py similarity index 98% rename from eland/tests/series/test_hist_pytest.py rename to tests/series/test_hist_pytest.py index dbedd07..46616a2 100644 --- a/eland/tests/series/test_hist_pytest.py +++ b/tests/series/test_hist_pytest.py @@ -22,7 +22,7 @@ import pandas as pd import pytest from pandas.testing import assert_frame_equal -from eland.tests.common import TestData +from tests.common import TestData class TestSeriesFrameHist(TestData): diff --git a/eland/tests/series/test_info_es_pytest.py b/tests/series/test_info_es_pytest.py similarity index 96% rename from eland/tests/series/test_info_es_pytest.py rename to tests/series/test_info_es_pytest.py index e478b2c..b4a15ba 100644 --- a/eland/tests/series/test_info_es_pytest.py +++ b/tests/series/test_info_es_pytest.py @@ -17,7 +17,7 @@ # File called _pytest for PyCharm compatability -from eland.tests.common import TestData +from tests.common import TestData class TestSeriesInfoEs(TestData): diff --git a/eland/tests/series/test_metrics_pytest.py b/tests/series/test_metrics_pytest.py similarity index 99% rename from eland/tests/series/test_metrics_pytest.py rename to tests/series/test_metrics_pytest.py index 01ce34a..bfb9512 100644 --- a/eland/tests/series/test_metrics_pytest.py +++ b/tests/series/test_metrics_pytest.py @@ -23,7 +23,7 @@ import numpy as np import pandas as pd import pytest -from eland.tests.common import TestData +from tests.common import TestData class TestSeriesMetrics(TestData): diff --git a/eland/tests/series/test_na_pytest.py b/tests/series/test_na_pytest.py similarity index 96% rename from eland/tests/series/test_na_pytest.py rename to tests/series/test_na_pytest.py index a11c91c..1486966 100644 --- a/eland/tests/series/test_na_pytest.py +++ b/tests/series/test_na_pytest.py @@ -16,7 +16,7 @@ # under the License. from eland import eland_to_pandas -from eland.tests.common import TestData, assert_pandas_eland_frame_equal +from tests.common import TestData, assert_pandas_eland_frame_equal class TestSeriesNA(TestData): diff --git a/eland/tests/series/test_name_pytest.py b/tests/series/test_name_pytest.py similarity index 92% rename from eland/tests/series/test_name_pytest.py rename to tests/series/test_name_pytest.py index 619aa9c..85a2d21 100644 --- a/eland/tests/series/test_name_pytest.py +++ b/tests/series/test_name_pytest.py @@ -17,8 +17,8 @@ # File called _pytest for PyCharm compatability import eland as ed -from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME -from eland.tests.common import TestData, assert_pandas_eland_series_equal +from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME +from tests.common import TestData, assert_pandas_eland_series_equal class TestSeriesName(TestData): diff --git a/eland/tests/series/test_rename_pytest.py b/tests/series/test_rename_pytest.py similarity index 92% rename from eland/tests/series/test_rename_pytest.py rename to tests/series/test_rename_pytest.py index b99b9bb..f5bd74a 100644 --- a/eland/tests/series/test_rename_pytest.py +++ b/tests/series/test_rename_pytest.py @@ -17,8 +17,8 @@ # File called _pytest for PyCharm compatability import eland as ed -from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME -from eland.tests.common import TestData, assert_pandas_eland_series_equal +from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME +from tests.common import TestData, assert_pandas_eland_series_equal class TestSeriesRename(TestData): diff --git a/eland/tests/series/test_repr_pytest.py b/tests/series/test_repr_pytest.py similarity index 95% rename from eland/tests/series/test_repr_pytest.py rename to tests/series/test_repr_pytest.py index 96d2e1a..679bea6 100644 --- a/eland/tests/series/test_repr_pytest.py +++ b/tests/series/test_repr_pytest.py @@ -19,8 +19,8 @@ import pandas as pd import eland as ed -from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME -from eland.tests.common import TestData +from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME +from tests.common import TestData class TestSeriesRepr(TestData): diff --git a/eland/tests/series/test_sample_pytest.py b/tests/series/test_sample_pytest.py similarity index 91% rename from eland/tests/series/test_sample_pytest.py rename to tests/series/test_sample_pytest.py index 184e4b3..d43dea7 100644 --- a/eland/tests/series/test_sample_pytest.py +++ b/tests/series/test_sample_pytest.py @@ -17,8 +17,8 @@ # File called _pytest for PyCharm compatibility import eland as ed -from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME -from eland.tests.common import TestData, assert_pandas_eland_series_equal +from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME +from tests.common import TestData, assert_pandas_eland_series_equal class TestSeriesSample(TestData): diff --git a/eland/tests/series/test_str_arithmetics_pytest.py b/tests/series/test_str_arithmetics_pytest.py similarity index 98% rename from eland/tests/series/test_str_arithmetics_pytest.py rename to tests/series/test_str_arithmetics_pytest.py index 9061ec2..54dc307 100644 --- a/eland/tests/series/test_str_arithmetics_pytest.py +++ b/tests/series/test_str_arithmetics_pytest.py @@ -18,7 +18,7 @@ # File called _pytest for PyCharm compatability import pytest -from eland.tests.common import TestData, assert_pandas_eland_series_equal +from tests.common import TestData, assert_pandas_eland_series_equal class TestSeriesArithmetics(TestData): diff --git a/eland/tests/series/test_value_counts_pytest.py b/tests/series/test_value_counts_pytest.py similarity index 98% rename from eland/tests/series/test_value_counts_pytest.py rename to tests/series/test_value_counts_pytest.py index a8ee095..a2e839b 100644 --- a/eland/tests/series/test_value_counts_pytest.py +++ b/tests/series/test_value_counts_pytest.py @@ -19,7 +19,7 @@ import pytest from pandas.testing import assert_series_equal -from eland.tests.common import TestData +from tests.common import TestData class TestSeriesValueCounts(TestData): diff --git a/eland/tests/setup_tests.py b/tests/setup_tests.py similarity index 99% rename from eland/tests/setup_tests.py rename to tests/setup_tests.py index a507523..dcea39c 100644 --- a/eland/tests/setup_tests.py +++ b/tests/setup_tests.py @@ -19,7 +19,7 @@ import pandas as pd from elasticsearch import helpers from eland.common import es_version -from eland.tests import ( +from tests import ( ECOMMERCE_FILE_NAME, ECOMMERCE_INDEX_NAME, ECOMMERCE_MAPPING, diff --git a/eland/tests/test_utils_pytest.py b/tests/test_utils_pytest.py similarity index 100% rename from eland/tests/test_utils_pytest.py rename to tests/test_utils_pytest.py