From efcf56cc22eacaf4e07b1a109d84f15d0876fd63 Mon Sep 17 00:00:00 2001 From: Mat Moore Date: Fri, 8 Nov 2024 09:29:43 +0000 Subject: [PATCH] fixup: remove primary key from csv We don't show this in the UI because it's not populated reliably, so we shouldn't included it in the csv either. --- home/service/details_csv.py | 2 -- tests/home/service/test_details_csv.py | 3 --- tests/test_views.py | 4 ++-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/home/service/details_csv.py b/home/service/details_csv.py index 69b8a2ff..4a3be3b2 100644 --- a/home/service/details_csv.py +++ b/home/service/details_csv.py @@ -14,7 +14,6 @@ def data(self): ( column.name, column.display_name, - column.is_primary_key, column.type, column.nullable, column.description, @@ -26,7 +25,6 @@ def headers(self): return [ "name", "display_name", - "is_primary_key", "type", "nullable", "description", diff --git a/tests/home/service/test_details_csv.py b/tests/home/service/test_details_csv.py index bf079ee5..d5f1a158 100644 --- a/tests/home/service/test_details_csv.py +++ b/tests/home/service/test_details_csv.py @@ -41,7 +41,6 @@ def test_dataset_details_csv_formatter(example_table): assert csv_formatter.headers() == [ "name", "display_name", - "is_primary_key", "type", "nullable", "description", @@ -50,7 +49,6 @@ def test_dataset_details_csv_formatter(example_table): ( "foo", "Foo", - True, "string", False, "an example", @@ -58,7 +56,6 @@ def test_dataset_details_csv_formatter(example_table): ( "bar", "Bar", - False, "integer", True, "another example", diff --git a/tests/test_views.py b/tests/test_views.py index d6aa1469..f1ca62da 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -68,8 +68,8 @@ def test_csv_output(self, client): response.headers["Content-Disposition"] == 'attachment; filename="fake.csv"' ) assert response.content == ( - b"name,display_name,is_primary_key,type,nullable,description\r\n" - + b"urn,urn,True,string,False,description **with markdown**\r\n" + b"name,display_name,type,nullable,description\r\n" + + b"urn,urn,string,False,description **with markdown**\r\n" )