mirror of
https://github.com/elastic/eland.git
synced 2025-07-11 00:02:14 +08:00
Move tests directory outside of eland namespace
This commit is contained in:
parent
56f6ba6c8b
commit
473db4576b
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
# Compiled python modules.
|
# Compiled python modules.
|
||||||
*.pyc
|
*.pyc
|
||||||
|
__pycache__/
|
||||||
|
|
||||||
# Setuptools distribution folder.
|
# Setuptools distribution folder.
|
||||||
dist/
|
dist/
|
||||||
@ -11,18 +12,19 @@ build/
|
|||||||
docs/build/
|
docs/build/
|
||||||
|
|
||||||
# pytest results
|
# pytest results
|
||||||
eland/tests/dataframe/results/
|
tests/dataframe/results/*csv
|
||||||
result_images/
|
result_images/
|
||||||
|
|
||||||
|
|
||||||
# Python egg metadata, regenerated from source files by setuptools.
|
# Python egg metadata, regenerated from source files by setuptools.
|
||||||
/*.egg-info
|
/*.egg-info
|
||||||
|
eland.egg-info/
|
||||||
|
|
||||||
# PyCharm files
|
# PyCharm files
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
# vscode files
|
# vscode files
|
||||||
.vscode/*
|
.vscode/
|
||||||
|
|
||||||
# pytest files
|
# pytest files
|
||||||
.pytest_cache/
|
.pytest_cache/
|
||||||
|
@ -79,8 +79,8 @@ Once your changes and tests are ready to submit for review:
|
|||||||
$ nox -s format
|
$ nox -s format
|
||||||
|
|
||||||
# Run the test suite
|
# Run the test suite
|
||||||
$ pytest --doctest-modules eland/tests/
|
$ pytest --doctest-modules tests/
|
||||||
$ pytest --nbval eland/tests/tests_notebook/
|
$ pytest --nbval tests/notebook/
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ currently using a minimum version of PyCharm 2019.2.4.
|
|||||||
* To setup test environment:
|
* To setup test environment:
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
> python -m eland.tests.setup_tests
|
> python -m tests.setup_tests
|
||||||
```
|
```
|
||||||
|
|
||||||
(Note this modifies Elasticsearch indices)
|
(Note this modifies Elasticsearch indices)
|
||||||
|
@ -87,7 +87,7 @@ Once your changes and tests are ready to submit for review:
|
|||||||
|
|
||||||
# Run the test suite
|
# Run the test suite
|
||||||
$ pytest --doctest-modules eland/tests/
|
$ pytest --doctest-modules eland/tests/
|
||||||
$ pytest --nbval eland/tests/tests_notebook/
|
$ pytest --nbval eland/tests/notebook/
|
||||||
|
|
||||||
2. Sign the Contributor License Agreement
|
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
|
- To setup test environment -*note this modifies Elasticsearch indices* run
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
python -m eland.tests.setup_tests
|
python -m tests.setup_tests
|
||||||
|
|
||||||
- To validate installation, open python console and run
|
- To validate installation, open python console and run
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
import eland as ed
|
import eland as ed
|
||||||
ed_df = ed.DataFrame('localhost', 'flights')
|
ed_df = ed.DataFrame('localhost', 'flights')
|
||||||
|
|
||||||
- To run the automatic formatter and check for lint issues
|
- To run the automatic formatter and check for lint issues
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
23
noxfile.py
23
noxfile.py
@ -22,13 +22,7 @@ from pathlib import Path
|
|||||||
import nox
|
import nox
|
||||||
|
|
||||||
BASE_DIR = Path(__file__).parent
|
BASE_DIR = Path(__file__).parent
|
||||||
SOURCE_FILES = (
|
SOURCE_FILES = ("setup.py", "noxfile.py", "eland/", "docs/", "utils/", "tests/")
|
||||||
"setup.py",
|
|
||||||
"noxfile.py",
|
|
||||||
"eland/",
|
|
||||||
"docs/",
|
|
||||||
"utils/",
|
|
||||||
)
|
|
||||||
|
|
||||||
# Whenever type-hints are completed on a file it should
|
# Whenever type-hints are completed on a file it should
|
||||||
# be added here so that this file will continue to be checked
|
# 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"])
|
@nox.session(python=["3.6", "3.7", "3.8"])
|
||||||
def test(session):
|
def test(session):
|
||||||
session.install("-r", "requirements-dev.txt")
|
session.install("-r", "requirements-dev.txt")
|
||||||
session.run("python", "-m", "eland.tests.setup_tests")
|
session.run("python", "-m", "tests.setup_tests")
|
||||||
session.install(".")
|
session.install(".")
|
||||||
session.run(
|
session.run(
|
||||||
|
"python",
|
||||||
|
"-m",
|
||||||
"pytest",
|
"pytest",
|
||||||
"--cov=eland",
|
"--cov-report",
|
||||||
|
"term-missing",
|
||||||
|
"--cov=eland/",
|
||||||
"--doctest-modules",
|
"--doctest-modules",
|
||||||
*(session.posargs or ("eland/",)),
|
|
||||||
"--nbval",
|
"--nbval",
|
||||||
"eland/tests/tests_notebook/",
|
*(session.posargs or ("eland/", "tests/")),
|
||||||
)
|
)
|
||||||
|
|
||||||
session.run(
|
session.run(
|
||||||
@ -119,7 +116,7 @@ def test(session):
|
|||||||
"xgboost",
|
"xgboost",
|
||||||
"lightgbm",
|
"lightgbm",
|
||||||
)
|
)
|
||||||
session.run("pytest", "eland/tests/ml/")
|
session.run("pytest", "tests/ml/")
|
||||||
|
|
||||||
|
|
||||||
@nox.session(reuse_venv=True)
|
@nox.session(reuse_venv=True)
|
||||||
@ -138,7 +135,7 @@ def docs(session):
|
|||||||
es = elasticsearch.Elasticsearch("localhost:9200")
|
es = elasticsearch.Elasticsearch("localhost:9200")
|
||||||
es.info()
|
es.info()
|
||||||
if not es.indices.exists("flights"):
|
if not es.indices.exists("flights"):
|
||||||
session.run("python", "-m", "eland.tests.setup_tests")
|
session.run("python", "-m", "tests.setup_tests")
|
||||||
es_active = True
|
es_active = True
|
||||||
except Exception:
|
except Exception:
|
||||||
es_active = False
|
es_active = False
|
||||||
|
@ -25,7 +25,7 @@ import eland as ed
|
|||||||
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
# Create pandas and eland data frames
|
# Create pandas and eland data frames
|
||||||
from eland.tests import (
|
from tests import (
|
||||||
ECOMMERCE_DF_FILE_NAME,
|
ECOMMERCE_DF_FILE_NAME,
|
||||||
ECOMMERCE_INDEX_NAME,
|
ECOMMERCE_INDEX_NAME,
|
||||||
ES_TEST_CLIENT,
|
ES_TEST_CLIENT,
|
@ -21,7 +21,7 @@ import numpy as np
|
|||||||
import pytest
|
import pytest
|
||||||
from pandas.testing import assert_frame_equal, assert_series_equal
|
from pandas.testing import assert_frame_equal, assert_series_equal
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameAggs(TestData):
|
class TestDataFrameAggs(TestData):
|
@ -18,7 +18,7 @@
|
|||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
|
|
||||||
import eland as ed
|
import eland as ed
|
||||||
from eland.tests.common import ES_TEST_CLIENT, TestData
|
from tests.common import ES_TEST_CLIENT, TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameBigMapping(TestData):
|
class TestDataFrameBigMapping(TestData):
|
@ -18,7 +18,7 @@
|
|||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
from pandas.testing import assert_series_equal
|
from pandas.testing import assert_series_equal
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameCount(TestData):
|
class TestDataFrameCount(TestData):
|
@ -24,7 +24,7 @@ from pandas.testing import assert_series_equal
|
|||||||
|
|
||||||
import eland as ed
|
import eland as ed
|
||||||
from eland.field_mappings import FieldMappings
|
from eland.field_mappings import FieldMappings
|
||||||
from eland.tests.common import (
|
from tests.common import (
|
||||||
ES_TEST_CLIENT,
|
ES_TEST_CLIENT,
|
||||||
TestData,
|
TestData,
|
||||||
assert_pandas_eland_frame_equal,
|
assert_pandas_eland_frame_equal,
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
from pandas.testing import assert_frame_equal
|
from pandas.testing import assert_frame_equal
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameDescribe(TestData):
|
class TestDataFrameDescribe(TestData):
|
@ -18,7 +18,7 @@
|
|||||||
# File called _pytest for PyCharm compatibility
|
# File called _pytest for PyCharm compatibility
|
||||||
|
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameDir(TestData):
|
class TestDataFrameDir(TestData):
|
@ -20,7 +20,7 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from eland.tests.common import assert_series_equal
|
from tests.common import assert_series_equal
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameDtypes:
|
class TestDataFrameDtypes:
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestEsMatch(TestData):
|
class TestEsMatch(TestData):
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from eland.tests.common import TestData, assert_eland_frame_equal
|
from tests.common import TestData, assert_eland_frame_equal
|
||||||
|
|
||||||
|
|
||||||
class TestDataEsQuery(TestData):
|
class TestDataEsQuery(TestData):
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameFilter(TestData):
|
class TestDataFrameFilter(TestData):
|
@ -21,7 +21,7 @@ import pandas as pd
|
|||||||
import pytest
|
import pytest
|
||||||
from pandas.testing import assert_frame_equal, assert_index_equal, assert_series_equal
|
from pandas.testing import assert_frame_equal, assert_index_equal, assert_series_equal
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestGroupbyDataFrame(TestData):
|
class TestGroupbyDataFrame(TestData):
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
# File called _pytest for PyCharm compatability
|
# 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):
|
class TestDataFrameHeadTail(TestData):
|
@ -21,7 +21,7 @@ import numpy as np
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
from pandas.testing import assert_frame_equal
|
from pandas.testing import assert_frame_equal
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameHist(TestData):
|
class TestDataFrameHist(TestData):
|
@ -19,8 +19,8 @@
|
|||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
import eland as ed
|
import eland as ed
|
||||||
from eland.tests import ES_TEST_CLIENT
|
from tests import ES_TEST_CLIENT
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameInfo(TestData):
|
class TestDataFrameInfo(TestData):
|
@ -21,7 +21,7 @@ import pytest
|
|||||||
|
|
||||||
import eland as ed
|
import eland as ed
|
||||||
from eland.query_compiler import QueryCompiler
|
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:
|
class TestDataFrameInit:
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
from pandas.testing import assert_index_equal
|
from pandas.testing import assert_index_equal
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameKeys(TestData):
|
class TestDataFrameKeys(TestData):
|
@ -22,7 +22,7 @@ import pandas as pd
|
|||||||
import pytest
|
import pytest
|
||||||
from pandas.testing import assert_frame_equal, assert_series_equal
|
from pandas.testing import assert_frame_equal, assert_series_equal
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameMetrics(TestData):
|
class TestDataFrameMetrics(TestData):
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
from pandas.testing import assert_series_equal
|
from pandas.testing import assert_series_equal
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameNUnique(TestData):
|
class TestDataFrameNUnique(TestData):
|
@ -20,7 +20,7 @@
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
import eland as ed
|
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):
|
class TestDataFrameQuery(TestData):
|
@ -21,7 +21,7 @@ import pandas as pd
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from eland.dataframe import DEFAULT_NUM_ROWS_DISPLAYED
|
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):
|
class TestDataFrameRepr(TestData):
|
||||||
@ -161,6 +161,9 @@ class TestDataFrameRepr(TestData):
|
|||||||
ed_ecom_r = repr(ed_ecom[ed_ecom["currency"] == "USD"])
|
ed_ecom_r = repr(ed_ecom[ed_ecom["currency"] == "USD"])
|
||||||
pd_ecom_r = repr(pd_ecom[pd_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
|
assert ed_ecom_r == pd_ecom_r
|
||||||
|
|
||||||
"""
|
"""
|
@ -20,7 +20,7 @@ import pytest
|
|||||||
from pandas.testing import assert_frame_equal
|
from pandas.testing import assert_frame_equal
|
||||||
|
|
||||||
from eland import eland_to_pandas
|
from eland import eland_to_pandas
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameSample(TestData):
|
class TestDataFrameSample(TestData):
|
@ -18,7 +18,7 @@
|
|||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
import numpy as np
|
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):
|
class TestDataFrameSelectDTypes(TestData):
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameShape(TestData):
|
class TestDataFrameShape(TestData):
|
@ -24,8 +24,8 @@ import pandas as pd
|
|||||||
from pandas.testing import assert_frame_equal
|
from pandas.testing import assert_frame_equal
|
||||||
|
|
||||||
import eland as ed
|
import eland as ed
|
||||||
from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
||||||
from eland.tests.common import ROOT_DIR, TestData
|
from tests.common import ROOT_DIR, TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDataFrameToCSV(TestData):
|
class TestDataFrameToCSV(TestData):
|
@ -23,7 +23,7 @@ import pytest
|
|||||||
|
|
||||||
import eland as ed
|
import eland as ed
|
||||||
from eland.field_mappings import FieldMappings
|
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):
|
class TestDataFrameUtils(TestData):
|
||||||
@ -137,7 +137,7 @@ class TestDataFrameUtils(TestData):
|
|||||||
|
|
||||||
ES_TEST_CLIENT.indices.delete(index=index_name)
|
ES_TEST_CLIENT.indices.delete(index=index_name)
|
||||||
|
|
||||||
def test_eland_to_pandas_performance(self):
|
def tests_to_pandas_performance(self):
|
||||||
# TODO quantify this
|
# TODO quantify this
|
||||||
ed.eland_to_pandas(self.ed_flights(), show_progress=True)
|
ed.eland_to_pandas(self.ed_flights(), show_progress=True)
|
||||||
|
|
@ -22,7 +22,7 @@ import pytest
|
|||||||
from elasticsearch.helpers import BulkIndexError
|
from elasticsearch.helpers import BulkIndexError
|
||||||
|
|
||||||
from eland import DataFrame, pandas_to_eland
|
from eland import DataFrame, pandas_to_eland
|
||||||
from eland.tests.common import (
|
from tests.common import (
|
||||||
ES_TEST_CLIENT,
|
ES_TEST_CLIENT,
|
||||||
assert_frame_equal,
|
assert_frame_equal,
|
||||||
assert_pandas_eland_frame_equal,
|
assert_pandas_eland_frame_equal,
|
@ -19,8 +19,8 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from eland.field_mappings import FieldMappings
|
from eland.field_mappings import FieldMappings
|
||||||
from eland.tests import ECOMMERCE_INDEX_NAME, ES_TEST_CLIENT
|
from tests import ECOMMERCE_INDEX_NAME, ES_TEST_CLIENT
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestAggregatables(TestData):
|
class TestAggregatables(TestData):
|
@ -19,7 +19,7 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from eland.field_mappings import FieldMappings
|
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):
|
class TestDateTime(TestData):
|
@ -19,8 +19,8 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from eland.field_mappings import FieldMappings
|
from eland.field_mappings import FieldMappings
|
||||||
from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDisplayNames(TestData):
|
class TestDisplayNames(TestData):
|
@ -19,8 +19,8 @@
|
|||||||
from pandas.testing import assert_series_equal
|
from pandas.testing import assert_series_equal
|
||||||
|
|
||||||
from eland.field_mappings import FieldMappings
|
from eland.field_mappings import FieldMappings
|
||||||
from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestDTypes(TestData):
|
class TestDTypes(TestData):
|
@ -20,8 +20,8 @@ import pytest
|
|||||||
from pandas.testing import assert_series_equal
|
from pandas.testing import assert_series_equal
|
||||||
|
|
||||||
from eland.field_mappings import FieldMappings
|
from eland.field_mappings import FieldMappings
|
||||||
from eland.tests import FLIGHTS_INDEX_NAME, FLIGHTS_MAPPING
|
from tests import FLIGHTS_INDEX_NAME, FLIGHTS_MAPPING
|
||||||
from eland.tests.common import ES_TEST_CLIENT, TestData
|
from tests.common import ES_TEST_CLIENT, TestData
|
||||||
|
|
||||||
|
|
||||||
class TestFieldNamePDDType(TestData):
|
class TestFieldNamePDDType(TestData):
|
@ -21,8 +21,8 @@ from pandas.testing import assert_index_equal
|
|||||||
|
|
||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
from eland.field_mappings import FieldMappings
|
from eland.field_mappings import FieldMappings
|
||||||
from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestGetFieldNames(TestData):
|
class TestGetFieldNames(TestData):
|
@ -19,7 +19,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from eland.field_mappings import FieldMappings
|
from eland.field_mappings import FieldMappings
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestMappingsWithType(TestData):
|
class TestMappingsWithType(TestData):
|
@ -20,8 +20,8 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from eland.field_mappings import FieldMappings
|
from eland.field_mappings import FieldMappings
|
||||||
from eland.tests import ECOMMERCE_INDEX_NAME, ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
from tests import ECOMMERCE_INDEX_NAME, ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestMetricSourceFields(TestData):
|
class TestMetricSourceFields(TestData):
|
@ -18,8 +18,8 @@
|
|||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
|
|
||||||
from eland.field_mappings import FieldMappings
|
from eland.field_mappings import FieldMappings
|
||||||
from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestRename(TestData):
|
class TestRename(TestData):
|
@ -21,8 +21,8 @@ from io import StringIO
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from eland.field_mappings import FieldMappings
|
from eland.field_mappings import FieldMappings
|
||||||
from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestScriptedFields(TestData):
|
class TestScriptedFields(TestData):
|
@ -19,7 +19,7 @@ import numpy as np
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from eland.ml import MLModel
|
from eland.ml import MLModel
|
||||||
from eland.tests import ES_TEST_CLIENT, ES_VERSION
|
from tests import ES_TEST_CLIENT, ES_VERSION
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from sklearn import datasets
|
from sklearn import datasets
|
@ -42,8 +42,8 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"2020-10-26 12:19:00.259395: read 10000 rows\n",
|
"2020-10-28 22:01:46.397163: read 10000 rows\n",
|
||||||
"2020-10-26 12:19:00.948930: read 13059 rows\n"
|
"2020-10-28 22:01:47.100938: read 13059 rows\n"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -77,6 +77,27 @@
|
|||||||
"execution_count": 5,
|
"execution_count": 5,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"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": {
|
"data": {
|
||||||
"text/html": [
|
"text/html": [
|
||||||
@ -205,6 +226,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"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)"
|
"ed.csv_to_eland(\"./test_churn.csv\", es_client='localhost', es_dest_index='churn', es_refresh=True, index_col=0)"
|
||||||
]
|
]
|
||||||
},
|
},
|
@ -20,7 +20,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from matplotlib.testing.decorators import check_figures_equal
|
from matplotlib.testing.decorators import check_figures_equal
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
@check_figures_equal(extensions=["png"])
|
@check_figures_equal(extensions=["png"])
|
@ -18,7 +18,7 @@
|
|||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
from matplotlib.testing.decorators import check_figures_equal
|
from matplotlib.testing.decorators import check_figures_equal
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
@check_figures_equal(extensions=["png"])
|
@check_figures_equal(extensions=["png"])
|
@ -18,7 +18,7 @@
|
|||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
|
|
||||||
from eland.query import Query
|
from eland.query import Query
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestQueryCopy(TestData):
|
class TestQueryCopy(TestData):
|
@ -20,7 +20,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from eland.query_compiler import QueryCompiler
|
from eland.query_compiler import QueryCompiler
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestEsMatch(TestData):
|
class TestEsMatch(TestData):
|
@ -19,7 +19,7 @@
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
from pandas.testing import assert_index_equal
|
from pandas.testing import assert_index_equal
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestGetFieldNames(TestData):
|
class TestGetFieldNames(TestData):
|
@ -19,7 +19,7 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
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):
|
class TestSeriesArithmetics(TestData):
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from eland.tests.common import TestData, assert_series_equal
|
from tests.common import TestData, assert_series_equal
|
||||||
|
|
||||||
|
|
||||||
class TestSeriesDescribe(TestData):
|
class TestSeriesDescribe(TestData):
|
@ -21,7 +21,7 @@ import numpy as np
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from eland.common import EMPTY_SERIES_DTYPE, build_pd_series
|
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():
|
def test_empty_series_dtypes():
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestEsMatch(TestData):
|
class TestEsMatch(TestData):
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
import pytest
|
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):
|
class TestSeriesFilter(TestData):
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
import eland as ed
|
import eland as ed
|
||||||
from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
||||||
from eland.tests.common import TestData, assert_pandas_eland_series_equal
|
from tests.common import TestData, assert_pandas_eland_series_equal
|
||||||
|
|
||||||
|
|
||||||
class TestSeriesHeadTail(TestData):
|
class TestSeriesHeadTail(TestData):
|
@ -22,7 +22,7 @@ import pandas as pd
|
|||||||
import pytest
|
import pytest
|
||||||
from pandas.testing import assert_frame_equal
|
from pandas.testing import assert_frame_equal
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestSeriesFrameHist(TestData):
|
class TestSeriesFrameHist(TestData):
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestSeriesInfoEs(TestData):
|
class TestSeriesInfoEs(TestData):
|
@ -23,7 +23,7 @@ import numpy as np
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestSeriesMetrics(TestData):
|
class TestSeriesMetrics(TestData):
|
@ -16,7 +16,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from eland import eland_to_pandas
|
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):
|
class TestSeriesNA(TestData):
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
import eland as ed
|
import eland as ed
|
||||||
from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
||||||
from eland.tests.common import TestData, assert_pandas_eland_series_equal
|
from tests.common import TestData, assert_pandas_eland_series_equal
|
||||||
|
|
||||||
|
|
||||||
class TestSeriesName(TestData):
|
class TestSeriesName(TestData):
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
import eland as ed
|
import eland as ed
|
||||||
from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
||||||
from eland.tests.common import TestData, assert_pandas_eland_series_equal
|
from tests.common import TestData, assert_pandas_eland_series_equal
|
||||||
|
|
||||||
|
|
||||||
class TestSeriesRename(TestData):
|
class TestSeriesRename(TestData):
|
@ -19,8 +19,8 @@
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
import eland as ed
|
import eland as ed
|
||||||
from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestSeriesRepr(TestData):
|
class TestSeriesRepr(TestData):
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
# File called _pytest for PyCharm compatibility
|
# File called _pytest for PyCharm compatibility
|
||||||
import eland as ed
|
import eland as ed
|
||||||
from eland.tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
from tests import ES_TEST_CLIENT, FLIGHTS_INDEX_NAME
|
||||||
from eland.tests.common import TestData, assert_pandas_eland_series_equal
|
from tests.common import TestData, assert_pandas_eland_series_equal
|
||||||
|
|
||||||
|
|
||||||
class TestSeriesSample(TestData):
|
class TestSeriesSample(TestData):
|
@ -18,7 +18,7 @@
|
|||||||
# File called _pytest for PyCharm compatability
|
# File called _pytest for PyCharm compatability
|
||||||
import pytest
|
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):
|
class TestSeriesArithmetics(TestData):
|
@ -19,7 +19,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from pandas.testing import assert_series_equal
|
from pandas.testing import assert_series_equal
|
||||||
|
|
||||||
from eland.tests.common import TestData
|
from tests.common import TestData
|
||||||
|
|
||||||
|
|
||||||
class TestSeriesValueCounts(TestData):
|
class TestSeriesValueCounts(TestData):
|
@ -19,7 +19,7 @@ import pandas as pd
|
|||||||
from elasticsearch import helpers
|
from elasticsearch import helpers
|
||||||
|
|
||||||
from eland.common import es_version
|
from eland.common import es_version
|
||||||
from eland.tests import (
|
from tests import (
|
||||||
ECOMMERCE_FILE_NAME,
|
ECOMMERCE_FILE_NAME,
|
||||||
ECOMMERCE_INDEX_NAME,
|
ECOMMERCE_INDEX_NAME,
|
||||||
ECOMMERCE_MAPPING,
|
ECOMMERCE_MAPPING,
|
Loading…
x
Reference in New Issue
Block a user