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: group by date field #563

Merged
merged 5 commits into from
Apr 16, 2024
Merged

fix: group by date field #563

merged 5 commits into from
Apr 16, 2024

Conversation

Sky-FE
Copy link
Contributor

@Sky-FE Sky-FE commented Apr 11, 2024

No description provided.

@Sky-FE Sky-FE requested review from Pengap and tea-artist April 11, 2024 12:22
@coveralls
Copy link
Collaborator

coveralls commented Apr 11, 2024

Pull Request Test Coverage Report for Build 8699066591

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 208 of 611 (34.04%) changed or added relevant lines in 13 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+61.5%) to 81.867%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/nestjs-backend/src/db-provider/sort-query/postgres/multiple-value/multiple-datetime-sort.adapter.ts 35 41 85.37%
apps/nestjs-backend/src/db-provider/sort-query/sqlite/multiple-value/multiple-datetime-sort.adapter.ts 34 40 85.0%
apps/nestjs-backend/src/db-provider/postgres.provider.ts 4 11 36.36%
apps/nestjs-backend/src/db-provider/sqlite.provider.ts 4 11 36.36%
apps/nestjs-backend/src/features/aggregation/aggregation.service.ts 2 23 8.7%
apps/nestjs-backend/src/db-provider/group-query/group-query.abstract.ts 7 88 7.95%
apps/nestjs-backend/src/db-provider/group-query/group-query.postgres.ts 8 144 5.56%
apps/nestjs-backend/src/db-provider/group-query/group-query.sqlite.ts 9 148 6.08%
Totals Coverage Status
Change from base Build 8631504197: 61.5%
Covered Lines: 27432
Relevant Lines: 33508

💛 - Coveralls

@Sky-FE Sky-FE linked an issue Apr 11, 2024 that may be closed by this pull request

const { isDistinct } = this.extra ?? {};
const { dbFieldName } = field;
const column = this.knex.raw(`CAST(?? as text)`, [dbFieldName]);
Copy link
Contributor

Choose a reason for hiding this comment

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

We can't simply cast JSON to a string.
Here is an example
if you have two multiple-date cells formatted as 'YYYY-MM-DD'
["2024-04-12T00:00:00.000Z"]
["2024-04-12T11:11:11.000Z"]
it should also be distinct as the same group

You should follow the code in search query implementation where correct parsing and matching of multi-valued fields is implemented, they have a similar logic

@Sky-FE Sky-FE merged commit 46d2754 into develop Apr 16, 2024
8 checks passed
@Sky-FE Sky-FE deleted the fix/date-field-group branch April 16, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Group by date, not datetime
3 participants