Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Report sorting in unique mode #4294

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

cservakt
Copy link
Collaborator

Fixing report sorting on unique mode. After modifying the DB schema in #4089 PR, the unique mode query of getRunResults endpoint has been changed, therefore, the report sorting is not working properly.

Now, the unique mode query is redesigned and it use row_number() function to filter unique reports correctly. Where clause is also modified. It is getting rid of report annotation filter. Filtering annotation remains in having clause.

@cservakt cservakt added this to the release 6.24.1 milestone Jul 12, 2024
@cservakt cservakt requested review from bruntib and vodorok as code owners July 12, 2024 12:34
@@ -1962,45 +1962,29 @@ def getRunResults(self, run_ids, limit, offset, sort_types,
ReportAnnotations.value)])).label(f"annotation_{col}")

if report_filter.isUnique:
# A report annotation filter cannot set in WHERE clause if we
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# A report annotation filter cannot set in WHERE clause if we
# A report annotation filter cannot be set in WHERE clause if we

@@ -1962,45 +1962,29 @@ def getRunResults(self, run_ids, limit, offset, sort_types,
ReportAnnotations.value)])).label(f"annotation_{col}")

if report_filter.isUnique:
# A report annotation filter cannot set in WHERE clause if we
# use annotation parameters in aggregate functions to create
# pivot table. Instead filtering report annotations in WHERE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# pivot table. Instead filtering report annotations in WHERE
# a pivot table. Instead of filtering report annotations in WHERE

# clause, we should use HAVING clause only for filtering
# aggregate functions.
# TODO: Fixing report annotation filter in every report server
# enpoint function.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# enpoint function.
# endpoint function.

# aggregate functions.
# TODO: Fixing report annotation filter in every report server
# enpoint function.
report_filter_annotations = report_filter.annotations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
report_filter_annotations = report_filter.annotations
annotations_backup = report_filter.annotations

Maybe such a name could cause less misunderstanding compared to that one-character difference.

@cservakt cservakt force-pushed the report-sorting-unique branch from 9894fc7 to 41866cb Compare August 1, 2024 09:06
@cservakt cservakt requested a review from bruntib August 1, 2024 09:07
Fixing report sorting on unique mode. After modifying the DB schema in Ericsson#4089 PR, the unique mode query of getRunResults endpoint has been changed, therefore, the report sorting is not working properly.

Now, the unique mode query is redesigned and it use row_number() function to filter unique reports correctly. Where clause is also modified. It is getting rid of report annotation filter. Filtering annotation remains in having clause.
@cservakt cservakt force-pushed the report-sorting-unique branch from 41866cb to cc7e526 Compare August 1, 2024 13:00
@bruntib bruntib merged commit f85f771 into Ericsson:master Aug 5, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants