Repository: zenml-io/zenml

Issue:
[BUG] training_pipeline.view_anomalies() raises error in the "quickstart" example
**Describe the bug**
training_pipeline.view_anomalies() raises error in the "quickstart" example

**To Reproduce**
I tried the "quickstart" example and anomalies function as well.

I just run `training_pipeline.view_anomalies()` after  `training_pipeline.run()`

**Expected behavior**
like screenshots

**Screenshots**
I try to change source code will get right return (maybe)
![image](https://user-images.githubusercontent.com/17194980/112293482-2745c400-8ccd-11eb-98dc-f97c688cc0a6.png)


**Stack Trace**
`
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-42-bbd89c69f860> in <module>
----> 1 training_pipeline.view_anomalies()

/opt/conda/lib/python3.8/site-packages/zenml/pipelines/training_pipeline.py in view_anomalies(self, split_name)
    338         schema_uri = self.get_artifacts_uri_by_component(
    339             GDPComponent.SplitSchema.name)[0]
--> 340         detect_anomalies(stats_uri, schema_uri, split_name)
    341 
    342     def steps_completed(self) -> bool:

/opt/conda/lib/python3.8/site-packages/zenml/utils/post_training/post_training_utils.py in detect_anomalies(stats_uri, schema_uri, split_name)
    108 def detect_anomalies(stats_uri: Text, schema_uri: Text, split_name: Text):
    109     schema = get_schema_proto(schema_uri)
--> 110     stats = get_statistics_dataset_dict(stats_uri)
    111     if split_name not in stats:
    112         raise Exception(f'{split_name} split not present!')

/opt/conda/lib/python3.8/site-packages/zenml/utils/post_training/post_training_utils.py in get_statistics_dataset_dict(stats_uri)
     69     """Get DatasetFeatureStatisticsList from stats URI"""
     70     result = {}
---> 71     for split in os.listdir(stats_uri):
     72         stats_path = os.path.join(stats_uri, split, 'stats_tfrecord')
     73         serialized_stats = next(

TypeError: listdir: path should be string, bytes, os.PathLike, integer or None, not list
`

** Context (please complete the following information):**
 - OS: Ubuntu 18.04
 - Python Version: 3.8.2
 - ZenML Version: 0.3.5

**Additional information**
Add any other context about the problem here.



Discussion:

Resolving patch:
diff --git a/zenml/pipelines/training_pipeline.py b/zenml/pipelines/training_pipeline.py
--- a/zenml/pipelines/training_pipeline.py
+++ b/zenml/pipelines/training_pipeline.py
@@ -334,7 +334,7 @@ def view_anomalies(self, split_name='eval'):
             split_name: name of split to detect anomalies on
         """
         stats_uri = self.get_artifacts_uri_by_component(
-            GDPComponent.SplitStatistics.name)
+            GDPComponent.SplitStatistics.name)[0]
         schema_uri = self.get_artifacts_uri_by_component(
             GDPComponent.SplitSchema.name)[0]
         detect_anomalies(stats_uri, schema_uri, split_name)


Test patch:
diff --git a/zenml/pipelines/training_pipeline_test.py b/zenml/pipelines/training_pipeline_test.py
new file mode 100644
--- /dev/null
+++ b/zenml/pipelines/training_pipeline_test.py
@@ -0,0 +1,28 @@
+#  Copyright (c) maiot GmbH 2021. All Rights Reserved.
+#
+#  Licensed 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.
+
+import os
+import random
+from pathlib import Path
+
+import zenml
+
+ZENML_ROOT = str(Path(zenml.__path__[0]).parent)
+TEST_ROOT = os.path.join(ZENML_ROOT, "tests")
+
+
+def test_view_anomalies(repo):
+    training_pipeline = random.choice(repo.get_pipelines_by_type(['training']))
+    assert training_pipeline.PIPELINE_TYPE == 'training'
+    training_pipeline.view_anomalies()