Repository: tensorflow/tfx

Issue #2065: AttributeError: 'list' object has no attribute 'type' [while running 'GenerateStatistics[train]
Created: 2020-06-28T05:39:50Z
https://colab.research.google.com/github/tensorflow/tfx/blob/master/docs/tutorials/tfx/components.ipynb
When running TFX example on google colab, got following errors
statistics_gen = StatisticsGen(
    examples=example_gen.outputs['examples'])
context.run(statistics_gen)
Error messages:
INFO:absl:Running driver for StatisticsGen
INFO:absl:MetadataStore with DB connection initialized
INFO:absl:Running executor for StatisticsGen
INFO:absl:Using 1 process(es) for Beam pipeline execution.
INFO:absl:Generating statistics for split train
INFO:absl:Statistics for split train written to /tmp/tfx-interactive-2020-06-28T05_35_31.021774-wrfcf4sp/StatisticsGen/statistics/2/train.
INFO:absl:Generating statistics for split eval
INFO:absl:Statistics for split eval written to /tmp/tfx-interactive-2020-06-28T05_35_31.021774-wrfcf4sp/StatisticsGen/statistics/2/eval.
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/apache_beam/runners/common.cpython-36m-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

98 frames
AttributeError: 'list' object has no attribute 'type'

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/tensorflow_data_validation/arrow/arrow_util.py in flatten_nested(array, return_parent_indices)
    192   parent_indices = None
    193 
--> 194   while is_list_like(array.type):
    195     if return_parent_indices:
    196       cur_parent_indices = array_util.GetFlattenedArrayParentIndices(

AttributeError: 'list' object has no attribute 'type' [while running 'GenerateStatistics[train]/RunStatsGenerators/GenerateSlicedStatisticsImpl/TopKUniquesStatsGenerator/ToTopKTuples']
TensorFlow version: 2.2.0
TFX version: 0.22.0
tensorflow-data-validation: 0.22.0

Duplicate issue #2068: AttributeError: 'list' object has no attribute 'type' [while running 'GenerateStatistics[train]
Created: 2020-06-29T06:47:06Z
https://colab.research.google.com/github/tensorflow/tfx/blob/master/docs/tutorials/tfx/components.ipynb
When running TFX example on google colab, got following errors
statistics_gen = StatisticsGen(
examples=example_gen.outputs['examples'])
context.run(statistics_gen)
Error messages:
INFO:absl:Running driver for StatisticsGen
INFO:absl:MetadataStore with DB connection initialized
INFO:absl:Running executor for StatisticsGen
INFO:absl:Using 1 process(es) for Beam pipeline execution.
INFO:absl:Generating statistics for split train
INFO:absl:Statistics for split train written to /tmp/tfx-interactive-2020-06-28T05_35_31.021774-wrfcf4sp/StatisticsGen/statistics/2/train.
INFO:absl:Generating statistics for split eval
INFO:absl:Statistics for split eval written to /tmp/tfx-interactive-2020-06-28T05_35_31.021774-wrfcf4sp/StatisticsGen/statistics/2/eval.
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/apache_beam/runners/common.cpython-36m-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()
98 frames
AttributeError: 'list' object has no attribute 'type'
During handling of the above exception, another exception occurred:
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/tensorflow_data_validation/arrow/arrow_util.py in flatten_nested(array, return_parent_indices)
192   parent_indices = None
193
--> 194   while is_list_like(array.type):
195     if return_parent_indices:
196       cur_parent_indices = array_util.GetFlattenedArrayParentIndices(
AttributeError: 'list' object has no attribute 'type' [while running 'GenerateStatistics[train]/RunStatsGenerators/GenerateSlicedStatisticsImpl/TopKUniquesStatsGenerator/ToTopKTuples']

Closing comment (2020-06-29T14:17:45Z): Yes, it is being tracked in #2065 . You can close it.
Please fix the bug.