Skip to content

Commit 88db67b

Browse files
committed
RF: no need for _DEFAULT_COLUMNS
1 parent 8d914f2 commit 88db67b

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

datalad_registry/overview.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,6 @@
4949
"metadata": {"label": "Metadata", "sortable": False},
5050
}
5151

52-
# Default columns to display
53-
_DEFAULT_COLUMNS = [
54-
"url",
55-
"dataset",
56-
"commit",
57-
"head_dt",
58-
"keys",
59-
"annexed_files_count",
60-
"annexed_files_size",
61-
"update",
62-
"git_objects",
63-
"metadata",
64-
]
65-
6652

6753
# Register humanize.intcomma as a Jinja2 filter
6854
bp.add_app_template_filter(intcomma, "intcomma")
@@ -99,9 +85,9 @@ def overview(): # No type hints due to mypy#7187.
9985
col for col in requested_columns if col in _AVAILABLE_COLUMNS
10086
]
10187
if not visible_columns:
102-
visible_columns = _DEFAULT_COLUMNS
88+
visible_columns = list(_AVAILABLE_COLUMNS)
10389
else:
104-
visible_columns = _DEFAULT_COLUMNS
90+
visible_columns = list(_AVAILABLE_COLUMNS)
10591

10692
# Handle sorting using new system
10793
sort_by_param = request.args.get("sort_by", default_sort_column, type=str)

datalad_registry/tests/test_overview.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,11 @@ def test_metadata(self, flask_client):
348348
@pytest.mark.parametrize(
349349
"columns_param, expected_header_count",
350350
[
351-
(None, 10), # Default columns
351+
(None, 10), # All available columns
352352
("url,dataset,commit", 3),
353353
("url,head_dt,update", 3),
354354
("url,keys,metadata", 3),
355-
("invalid_column", 10), # Invalid columns fall back to default
355+
("invalid_column", 10), # Invalid columns fall back to all columns
356356
("url,invalid_column,dataset", 2), # Valid columns only
357357
],
358358
)

0 commit comments

Comments
 (0)