# Buggy code
def __init__(
    self,
    paths,
    part_size,
    storage_options,
    row_groups_per_part=None,
    legacy=False,
    batch_size=None,
):
    # TODO: Improve dask_cudf.read_parquet performance so that
    # this class can be slimmed down.
    super().__init__(paths, part_size, storage_options)
    self.batch_size = batch_size
    self._metadata, self._base = self.metadata
    self._pieces = None
    if row_groups_per_part is None:
        file_path = self._metadata.row_group(0).column(0).file_path
        path0 = (
            self.fs.sep.join([self._base, file_path])
            if file_path != ""
            else self._base  # This is a single file
        )

    if row_groups_per_part is None:
        rg_byte_size_0 = (
            cudf.io.read_parquet(path0, row_groups=0, row_group=0)
            .memory_usage(deep=True, index=True)
            .sum()
        )
        row_groups_per_part = self.part_size / rg_byte_size_0
        if row_groups_per_part < 1.0:
            warnings.warn(
                f"Row group size {rg_byte_size_0} is bigger than requested part_size "
                f"{self.part_size}"
            )
            row_groups_per_part = 1.0

    self.row_groups_per_part = int(row_groups_per_part)

    assert self.row_groups_per_part > 0


# Traceback (AttributeError)
Traceback (most recent call last):
File "main.py", line 106, in <module>
main(args)
File "main.py", line 61, in main
train_paths, engine="parquet", part_mem_fraction=float(args.gpu_mem_frac)
File "/root/miniconda/lib/python3.7/site-packages/nvtabular/io/dataset.py", line 224, in __init__
paths, part_size, storage_options=storage_options, **kwargs
File "/root/miniconda/lib/python3.7/site-packages/nvtabular/io/parquet.py", line 69, in __init__
.memory_usage(deep=True, index=True)
File "/root/miniconda/lib/python3.7/site-packages/cudf/core/dataframe.py", line 842, in memory_usage
sizes = [col._memory_usage(deep=deep) for col in self._data.columns]
File "/root/miniconda/lib/python3.7/site-packages/cudf/core/dataframe.py", line 842, in <listcomp>
sizes = [col._memory_usage(deep=deep) for col in self._data.columns]
File "/root/miniconda/lib/python3.7/site-packages/cudf/core/column/column.py", line 299, in _memory_usage
return self.__sizeof__()
File "/root/miniconda/lib/python3.7/site-packages/cudf/core/column/column.py", line 183, in __sizeof__
n = self.data.size
File "cudf/_lib/column.pyx", line 99, in cudf._lib.column.Column.data.__get__
AttributeError: 'ListDtype' object has no attribute 'itemsize'

# Fixed code
def __init__(
    self,
    paths,
    part_size,
    storage_options,
    row_groups_per_part=None,
    legacy=False,
    batch_size=None,
):
    # TODO: Improve dask_cudf.read_parquet performance so that
    # this class can be slimmed down.
    super().__init__(paths, part_size, storage_options)
    self.batch_size = batch_size
    self._metadata, self._base = self.metadata
    self._pieces = None
    if row_groups_per_part is None:
        file_path = self._metadata.row_group(0).column(0).file_path
        path0 = (
            self.fs.sep.join([self._base, file_path])
            if file_path != ""
            else self._base  # This is a single file
        )

    if row_groups_per_part is None:
        rg_byte_size_0 = _memory_usage(
            cudf.io.read_parquet(path0, row_groups=0, row_group=0)
        )
        row_groups_per_part = self.part_size / rg_byte_size_0
        if row_groups_per_part < 1.0:
            warnings.warn(
                f"Row group size {rg_byte_size_0} is bigger than requested part_size "
                f"{self.part_size}"
            )
            row_groups_per_part = 1.0

    self.row_groups_per_part = int(row_groups_per_part)

    assert self.row_groups_per_part > 0