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

[BUG][Discover] Check if the timestamp is already included to remove duplicate col #6983

Merged
merged 3 commits into from
Jun 17, 2024

Conversation

ananzh
Copy link
Member

@ananzh ananzh commented Jun 10, 2024

Issues Resolved

#6982

Screenshot

Changelog

  • fix: [Discover] Check if the timestamp is already included to remove duplicate col

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link

codecov bot commented Jun 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.46%. Comparing base (2c58c99) to head (39fd156).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6983      +/-   ##
==========================================
+ Coverage   67.45%   67.46%   +0.01%     
==========================================
  Files        3442     3443       +1     
  Lines       67816    67829      +13     
  Branches    11027    11035       +8     
==========================================
+ Hits        45742    45761      +19     
+ Misses      19408    19398      -10     
- Partials     2666     2670       +4     
Flag Coverage Δ
Linux_1 33.08% <ø> (ø)
Linux_2 55.11% <ø> (ø)
Linux_3 45.20% <100.00%> (+<0.01%) ⬆️
Linux_4 34.86% <ø> (ø)
Windows_1 33.13% <ø> (+0.02%) ⬆️
Windows_2 55.06% <ø> (ø)
Windows_3 45.22% <100.00%> (+<0.01%) ⬆️
Windows_4 34.86% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -29,7 +29,7 @@
*/

import React, { useRef, useEffect } from 'react';
import { DocViewRenderFn, DocViewRenderProps } from '../../../doc_views/doc_views_types';
import { DocViewRenderFn, DocViewRenderProps } from '../../doc_views/doc_views_types';
Copy link
Collaborator

Choose a reason for hiding this comment

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

How did this build if this wasn't imported correctly?

Copy link
Member Author

Choose a reason for hiding this comment

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

I do see a type error when I debug the issue

Cannot find module '../../../doc_views/doc_views_types' or its corresponding type declarations.ts(2307)

I believe this is related to an old discussion #1660, which highlights that the standard build scripts in the project do not fail on or show TypeScript errors. This has led to a situation where TypeScript compilation errors (like the one I encountered) do not cause the build to fail, allowing many such errors to creep into the project unnoticed.

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe we don't have the bandwidth to address this issue right now, but we should consider implementing a way to prevent new type errors from being added. This will help ensure the problem doesn't grow larger.

CC: @AMoo-Miki @ashwin-pc

Copy link
Member

Choose a reason for hiding this comment

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

Yeah typescript error right now rely on the IDE or us manually running tsc and validating the diff. I have a work in progress PR to help catch this in the CI but its not complete yet. #6586

Comment on lines 97 to 99
return !hideTimeField &&
indexPattern.timeFieldName &&
!columns.includes(indexPattern.timeFieldName)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: consider assigning this to a meaningfully named variable so the reader doesn't have to parse out what this is trying to do

Copy link
Member Author

Choose a reason for hiding this comment

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

Will think a good name and update

ananzh and others added 3 commits June 11, 2024 21:11
@ananzh ananzh added bug Something isn't working discover for discover reinvent labels Jun 11, 2024
@ananzh ananzh merged commit 0db5848 into opensearch-project:main Jun 17, 2024
75 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jun 17, 2024
…duplicate col (#6983)

* check if the timestamp is already included to remove duplicate col

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 0db5848)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
mengweieric pushed a commit to mengweieric/OpenSearch-Dashboards that referenced this pull request Jun 24, 2024
…duplicate col (opensearch-project#6983)

* check if the timestamp is already included to remove duplicate col

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 23, 2024
…duplicate col (#6983)

* check if the timestamp is already included to remove duplicate col

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 0db5848)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ananzh pushed a commit that referenced this pull request Jul 23, 2024
…duplicate col (#6983) (#7399)

* check if the timestamp is already included to remove duplicate col

---------



(cherry picked from commit 0db5848)

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
LDrago27 pushed a commit that referenced this pull request Jul 23, 2024
…duplicate col (#6983) (#7047)

* check if the timestamp is already included to remove duplicate col

---------



(cherry picked from commit 0db5848)

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants