Repository: blue-yonder/tsfresh

Issue:
the install process is globally installing a "tests" module (using version 0.12)
Oh no, you encountered a problem while using *tsfesh*.

We, the maintainers, are happy to help you. When opening an issue, please provide the following information to us:

1. Your operating system

Ubuntu 18

2. The version of *tsfresh* that you are using

0.12

3. The data on which the problem occurred (please do not upload 1000s of time series but try to boil the problem down to a small group or even a singular one)
4. A minimal code snippet which reproduces the problem/bug
5. Any reported errors or traceback

For questions, you can also use our [gitter chatroom](https://gitter.im/tsfresh/)

Question 3-5 don't apply as this is an installation issue.

This version is globally installing a ``tests`` module, thus polluting the global namespace of modules with its own tests.

Once tsfresh is installed, we find the following under ``.../lib/python3.7/site-packages/tests``:

```
├── fixtures.py
├── __init__.py
├── integrations
│   ├── examples
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-37.pyc
│   │   │   ├── test_driftbif_simulation.cpython-37.pyc
│   │   │   ├── test_har_dataset.cpython-37.pyc
│   │   │   └── test_robot_execution_failures.cpython-37.pyc
│   │   ├── test_driftbif_simulation.py
│   │   ├── test_har_dataset.py
│   │   └── test_robot_execution_failures.py
│   ├── __init__.py
│   ├── __pycache__
│   │   ├── __init__.cpython-37.pyc
│   │   ├── test_full_pipeline.cpython-37.pyc
│   │   ├── test_notebooks.cpython-37.pyc
│   │   └── test_relevant_feature_extraction.cpython-37.pyc
│   ├── test_full_pipeline.py
│   ├── test_notebooks.py
│   └── test_relevant_feature_extraction.py
├── __pycache__
│   ├── fixtures.cpython-37.pyc
│   └── __init__.cpython-37.pyc
└── units
    ├── feature_extraction
    │   ├── __init__.py
    │   ├── __pycache__
    │   │   ├── __init__.cpython-37.pyc
    │   │   ├── test_extraction.cpython-37.pyc
    │   │   ├── test_feature_calculations.cpython-37.pyc
    │   │   └── test_settings.cpython-37.pyc
    │   ├── test_extraction.py
    │   ├── test_feature_calculations.py
    │   └── test_settings.py
    ├── feature_selection
    │   ├── __init__.py
    │   ├── __pycache__
    │   │   ├── __init__.cpython-37.pyc
    │   │   ├── test_benjamini_hochberg_test.cpython-37.pyc
    │   │   ├── test_checks.cpython-37.pyc
    │   │   ├── test_feature_significance.cpython-37.pyc
    │   │   ├── test_relevance.cpython-37.pyc
    │   │   ├── test_selection.cpython-37.pyc
    │   │   └── test_significance_tests.cpython-37.pyc
    │   ├── test_benjamini_hochberg_test.py
    │   ├── test_checks.py
    │   ├── test_feature_significance.py
    │   ├── test_relevance.py
    │   ├── test_selection.py
    │   └── test_significance_tests.py
    ├── __init__.py
    ├── __pycache__
    │   └── __init__.cpython-37.pyc
    ├── scripts
    │   ├── __init__.py
    │   ├── __pycache__
    │   │   ├── __init__.cpython-37.pyc
    │   │   └── test_run_tsfresh.cpython-37.pyc
    │   └── test_run_tsfresh.py
    ├── transformers
    │   ├── __init__.py
    │   ├── __pycache__
    │   │   ├── __init__.cpython-37.pyc
    │   │   ├── test_feature_augmenter.cpython-37.pyc
    │   │   ├── test_feature_selector.cpython-37.pyc
    │   │   ├── test_per_column_imputer.cpython-37.pyc
    │   │   └── test_relevant_feature_augmenter.cpython-37.pyc
    │   ├── test_feature_augmenter.py
    │   ├── test_feature_selector.py
    │   ├── test_per_column_imputer.py
    │   └── test_relevant_feature_augmenter.py
    └── utilities
        ├── __init__.py
        ├── __pycache__
        │   ├── __init__.cpython-37.pyc
        │   ├── test_dataframe_functions.cpython-37.pyc
        │   ├── test_distribution.cpython-37.pyc
        │   └── test_string_manipilations.cpython-37.pyc
        ├── test_dataframe_functions.py
        ├── test_distribution.py
        └── test_string_manipilations.py
```


Discussion:

Patch:
diff --git a/setup.py b/setup.py
index be4e01e..9022dc0 100644
--- a/setup.py
+++ b/setup.py
@@ -25,6 +25,6 @@ setup(
     long_description=long_description,
     long_description_content_type="text/markdown",
     setup_requires=["six", "setuptools_scm"] + sphinx,
-    packages=find_packages(),
+    packages=find_packages(exclude=["tests.*", "tests"]),
     install_requires=requirements,
 )
diff --git a/tsfresh/utilities/dataframe_functions.py b/tsfresh/utilities/dataframe_functions.py
index 381cc71..8d9a59c 100644
--- a/tsfresh/utilities/dataframe_functions.py
+++ b/tsfresh/utilities/dataframe_functions.py
@@ -321,12 +321,14 @@ def _normalize_input_to_internal_representation(timeseries_container, column_id,
         column_kind = "_variables"
         column_value = "_values"
 
+        if not set(timeseries_container.columns) - {column_id}:
+            raise ValueError("There is no column with values in your data!")
+
         timeseries_container.index.name = 'index'
         timeseries_container = pd.melt(timeseries_container.reset_index(),
                                        id_vars=['index', column_id],
                                        value_name=column_value, var_name=column_kind)
         timeseries_container = timeseries_container.set_index('index')
-
         timeseries_container[column_sort] = np.tile(sort, (len(timeseries_container) // len(sort)))
 
     # Check kind column


Test patch:
diff --git a/tests/units/utilities/test_dataframe_functions.py b/tests/units/utilities/test_dataframe_functions.py
index f498ee0..8181a97 100644
--- a/tests/units/utilities/test_dataframe_functions.py
+++ b/tests/units/utilities/test_dataframe_functions.py
@@ -138,6 +138,15 @@ class NormalizeTestCase(TestCase):
         self.assertRaises(ValueError, dataframe_functions._normalize_input_to_internal_representation, test_df,
                           None, None, None, "value")
 
+        test_df = pd.DataFrame([{"id": 0}])
+        self.assertRaises(ValueError, dataframe_functions._normalize_input_to_internal_representation, test_df,
+                          "id", None, None, None)
+
+        test_df = pd.DataFrame([{"id": 0, "sort": 0}])
+        self.assertRaises(ValueError, dataframe_functions._normalize_input_to_internal_representation, test_df,
+                          "id", "sort", None, None)
+
+
     def test_wide_dataframe_order_preserved_with_sort_column(self):
         """ verifies that the order of the sort column from a wide time series container is preserved
         """