Commit c7e1cbfa authored by hujambo-dunia's avatar hujambo-dunia
Browse files

Fix for not-null in 'column_list' object

parent 9a7d1f2c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1807,7 +1807,7 @@ class CMAP(TabularData):
            with open(dataset.get_file_name()) as dataset_fh:
                comment_lines = 0
                column_headers = None
                cleaned_column_types = None
                cleaned_column_types = []
                number_of_columns = 0
                for i, line in enumerate(dataset_fh):
                    line = line.strip("\n")
@@ -1815,7 +1815,6 @@ class CMAP(TabularData):
                        if line.startswith("#h"):
                            column_headers = line.split("\t")[1:]
                        elif line.startswith("#f"):
                            cleaned_column_types = []
                            for column_type in line.split("\t")[1:]:
                                if column_type == "Hex":
                                    cleaned_column_types.append("str")
+1 −1
Original line number Diff line number Diff line
@@ -1512,7 +1512,7 @@ class ColumnListParameter(SelectToolParameter):
                except Exception:
                    column_list = self.get_column_list(trans, other_values)
            if self.numerical:  # If numerical was requested, filter columns based on metadata
                if hasattr(dataset, "metadata") and hasattr(dataset.metadata, "column_types"):
                if hasattr(dataset, "metadata") and getattr(dataset.metadata, "column_types", None) is not None:
                    if len(dataset.metadata.column_types) >= len(column_list):
                        numerics = [i for i, x in enumerate(dataset.metadata.column_types) if x in ["int", "float"]]
                        column_list = [column_list[i] for i in numerics]