# Buggy code
def _get_extract_iter(self) -> Iterator[TableMetadata]:
    for row in self._get_raw_extract_iter():
        columns, i = [], 0

        for column in row["StorageDescriptor"]["Columns"] + row.get(
            "PartitionKeys", []
        ):
            columns.append(
                ColumnMetadata(
                    column["Name"],
                    column["Comment"] if "Comment" in column else None,
                    column["Type"],
                    i,
                )
            )
            i += 1

        catalog, schema, table = self._parse_location(
            location=row["StorageDescriptor"]["Location"], name=row["Name"]
        )

        if self._connection_name:
            database = self._connection_name + "/" + row["DatabaseName"]
        else:
            database = row["DatabaseName"]

        yield TableMetadata(
            database,
            catalog,
            schema,
            table,
            row.get("Description") or row.get("Parameters", {}).get("comment"),
            columns,
            row.get("TableType") == "VIRTUAL_VIEW",
        )


# Traceback (IndexError)
Traceback (most recent call last):
File "/usr/local/Cellar/whale/v1.1.4/bin/../libexec/build_script.py", line 23, in <module>
pull()
File "/usr/local/Cellar/whale/v1.1.4/libexec/env/lib/python3.8/site-packages/whale/utils/task_wrappers.py", line 113, in pull
task.run()
File "/usr/local/Cellar/whale/v1.1.4/libexec/env/lib/python3.8/site-packages/whale/task/__init__.py", line 23, in run
record = self.extractor.extract()
File "/usr/local/Cellar/whale/v1.1.4/libexec/env/lib/python3.8/site-packages/whale/extractor/glue_extractor.py", line 28, in extract
return next(self._extract_iter)
File "/usr/local/Cellar/whale/v1.1.4/libexec/env/lib/python3.8/site-packages/whale/extractor/glue_extractor.py", line 52, in _get_extract_iter
catalog, schema, table = self._parse_location(
File "/usr/local/Cellar/whale/v1.1.4/libexec/env/lib/python3.8/site-packages/whale/extractor/glue_extractor.py", line 91, in _parse_location
table = splits[-1]
IndexError: list index out of range

# Fixed code
def _get_extract_iter(self) -> Iterator[TableMetadata]:
    for row in self._get_raw_extract_iter():
        columns, i = [], 0

        for column in row["StorageDescriptor"]["Columns"] + row.get(
            "PartitionKeys", []
        ):
            columns.append(
                ColumnMetadata(
                    column["Name"],
                    column["Comment"] if "Comment" in column else None,
                    column["Type"],
                    i,
                )
            )
            i += 1

        if self._is_location_parsing_enabled:
            catalog, schema, table = self._parse_location(
                location=row["StorageDescriptor"]["Location"], name=row["Name"]
            )
        else:
            catalog = None
            schema = None
            table = row["Name"]

        if self._connection_name:
            database = self._connection_name + "/" + row["DatabaseName"]
        else:
            database = row["DatabaseName"]

        yield TableMetadata(
            database,
            catalog,
            schema,
            table,
            row.get("Description") or row.get("Parameters", {}).get("comment"),
            columns,
            row.get("TableType") == "VIRTUAL_VIEW",
        )