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(analytics): remove zero values being added in charts #7425

Merged
merged 3 commits into from
Feb 25, 2023

Conversation

anshbansal
Copy link
Collaborator

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Feb 24, 2023
Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a comment

Choose a reason for hiding this comment

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

nice! love the tests. two quick questions and then let's move this forward

final DateTime now = DateTime.now();
final DateTime aWeekAgo = now.minusWeeks(1);
final DateTime endOfWeek = DateTime.now()
.plusDays(1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume you add plusDays(1) here in case today is Sunday and we need to get the following sunday? and this is all good if today is Saturday?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What I wanted was the exact end of Sunday. I initially tried that by setting things as 23:59:59.999 but the rendering on the frontend added one point with zero for the exact end. So decided to make it the exact beginning of next Monday by adding plus 1 days.

@@ -25,7 +25,7 @@ type Props = {
const MARGIN_SIZE = 40;

function insertBlankAt(ts: number, newLine: Array<NumericDataPoint>) {
const dateString = new Date(ts).toString();
const dateString = new Date(ts).toISOString();
Copy link
Collaborator

Choose a reason for hiding this comment

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

why this change here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For the tests basically. Otherwise it would contain people's timezone in the string and it become impossible to test this out for everyone.

Copy link
Collaborator

@jjoyce0510 jjoyce0510 left a comment

Choose a reason for hiding this comment

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

Okay for now. Let's keep an eye on this obviously

@anshbansal anshbansal merged commit 4e7233d into master Feb 25, 2023
@anshbansal anshbansal deleted the aseem-fix-mau-chart branch February 25, 2023 08:39
it('add date interval works correctly', () => {
const input = new Date(1677242304000);
const afterAdd = addInterval(1, input, DateInterval.Month);
const expected = new Date(1679661504000);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is failing for me because the result is an hour off in my timezone, I think because the next month in my timezone is an hour shorter due to daylight savings? The result I get is 1679657904000. Is the addInterval function calculating the interval in GMT time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#7484 Will see if we can reliably reproduce the failure in CI. Then we will work on fixing it. This should have been caught in the CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants