Skip to content

Commit

Permalink
Merge pull request #18553 from hujambo-dunia/fix-columnlist-datatype
Browse files Browse the repository at this point in the history
[24.0] Fix for not-null in 'column_list' object
  • Loading branch information
nsoranzo authored Jul 25, 2024
2 parents 9a7d1f2 + c7e1cbf commit 1a0a706
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/galaxy/datatypes/tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -1807,15 +1807,14 @@ def set_meta(
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")
if line.startswith("#"):
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")
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/tools/parameters/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,7 @@ def get_options(self, trans, other_values):
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]
Expand Down

0 comments on commit 1a0a706

Please sign in to comment.