Skip to content

Commit 68a39c3

Browse files
[core] fix: don't include skipped fields in report columns
1 parent 4822a73 commit 68a39c3

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

libs/core/garf_core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
'ApiReportFetcher',
2727
]
2828

29-
__version__ = '0.6.0'
29+
__version__ = '0.6.1'

libs/core/garf_core/report_fetcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def fetch(
183183
parsed_response = self.parser(query).parse_response(response)
184184
fetched_report = report.GarfReport(
185185
results=parsed_response,
186-
column_names=query.column_names,
186+
column_names=[c for c in query.column_names if c != '_'],
187187
query_specification=query,
188188
)
189189
if self.enable_cache:

libs/core/tests/unit/test_report_fetcher.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ def test_fetch_returns_correct_report_for_dict_parser(
5252

5353
assert test_report == expected_report
5454

55+
def test_fetch_skips_omitted_column(self, test_dict_report_fetcher):
56+
query = 'SELECT column.name AS _, other_column FROM test'
57+
test_report = test_dict_report_fetcher.fetch(query)
58+
59+
expected_report = report.GarfReport(
60+
results=[[2], [2], [2]],
61+
column_names=['other_column'],
62+
)
63+
64+
assert test_report == expected_report
65+
5566
def test_fetch_returns_saves_and_loads_cached_version(self, caplog, tmp_path):
5667
test_api_client = api_clients.FakeApiClient(
5768
results=[

0 commit comments

Comments
 (0)