# Buggy code
def get(self):
    """Will return the additional data keys and the dict."""

    self.progress.new("Recovering additional keys and data for %s" % self.target)
    self.progress.update("...")
    database = db.DB(self.db_path, utils.get_required_version_for_db(self.db_path))
    additional_data = database.get_table_as_dict(self.table_name)
    additional_data_keys = database.get_single_column_from_table(
        self.table_name, "data_key", unique=True
    )
    additional_data_item_names = database.get_single_column_from_table(
        self.table_name, "item_name", unique=True
    )
    database.disconnect()

    if not len(additional_data_item_names):
        self.progress.end()
        return [], {}

    d = {}
    for additional_data_item_name in additional_data_item_names:
        d[additional_data_item_name] = {}

    for entry in additional_data.values():
        additional_data_item_name = entry["item_name"]
        key = entry["data_key"]
        value = entry["data_value"]

        if entry["data_type"] in ["int", "float"]:
            d[additional_data_item_name][key] = eval(entry["data_type"])(value)
        else:
            d[additional_data_item_name][key] = value

    for additional_data_item_name in d:
        for key in additional_data_keys:
            if key not in d[additional_data_item_name]:
                d[additional_data_item_name][key] = None

    self.progress.end()

    return additional_data_keys, d


# Traceback (TypeError)
Traceback (most recent call last):
File "/Users/alonshaiber/github/anvio/bin/anvi-display-pan", line 74, in <module>
d = interactive.Interactive(args)
File "/Users/alonshaiber/github/anvio/anvio/interactive.py", line 106, in __init__
self.layers_order_data_dict = TableForLayerOrders(self.args).get(self.layers_additional_data_keys, self.layers_additional_data_dict) if a_db_is_found else {}
File "/Users/alonshaiber/github/anvio/anvio/tables/miscdata.py", line 256, in get
return self.update_orders_dict_using_additional_data_dict(d, additional_data_keys, additional_data_dict)
File "/Users/alonshaiber/github/anvio/anvio/tables/miscdata.py", line 276, in update_orders_dict_using_additional_data_dict
order_data_dict['>> ' + data_key] = {'newick': None, 'basic': ','.join([t[1] for t in sorted(layer_name_layer_data_tuples)])}
TypeError: '<' not supported between instances of 'NoneType' and 'str

# Fixed code
def get(self):
    """Will return the additional data keys and the dict."""

    self.progress.new("Recovering additional keys and data for %s" % self.target)
    self.progress.update("...")
    database = db.DB(self.db_path, utils.get_required_version_for_db(self.db_path))
    additional_data = database.get_table_as_dict(self.table_name)
    additional_data_keys = database.get_single_column_from_table(
        self.table_name, "data_key", unique=True
    )
    additional_data_item_names = database.get_single_column_from_table(
        self.table_name, "item_name", unique=True
    )
    database.disconnect()

    if not len(additional_data_item_names):
        self.progress.end()
        return [], {}

    d = {}
    for additional_data_item_name in additional_data_item_names:
        d[additional_data_item_name] = {}

    for entry in additional_data.values():
        additional_data_item_name = entry["item_name"]
        key = entry["data_key"]
        value = entry["data_value"]

        if entry["data_type"] in ["int", "float"]:
            d[additional_data_item_name][key] = eval(entry["data_type"])(
                value or self.nulls_per_type[entry["data_type"]]
            )
        else:
            d[additional_data_item_name][key] = value

    for additional_data_item_name in d:
        for key in additional_data_keys:
            if key not in d[additional_data_item_name]:
                d[additional_data_item_name][key] = None

    self.progress.end()

    return additional_data_keys, d