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

949 missing leg in miovision_api.open_issues join #950

Merged
merged 6 commits into from
Jul 12, 2024

Conversation

gabrielwol
Copy link
Collaborator

@gabrielwol gabrielwol commented May 10, 2024

What this pull request accomplishes:

  • The addition of leg to anomalous_ranges broke the open_issues view + data check.
  • Other minor improvements include: fixing the last_week_volume to only look at dates within the AR + formatting that number with commas
  • fix a bad join with alerts table which caused last_week_volumes to appear higher.

Issue(s) this solves:

What, in particular, needs to reviewed:

What needs to be done by a sysadmin after this PR is merged

  • nothing, changes already implemented

@gabrielwol gabrielwol requested a review from chmnata May 10, 2024 16:29
@gabrielwol gabrielwol self-assigned this May 10, 2024
@gabrielwol gabrielwol linked an issue May 10, 2024 that may be closed by this pull request
@gabrielwol gabrielwol changed the title 949 missing leg in miovisionopen issues join 949 missing leg in miovision_api.open_issues join May 10, 2024
@gabrielwol gabrielwol marked this pull request as draft May 10, 2024 19:23
@gabrielwol gabrielwol marked this pull request as ready for review May 10, 2024 19:39
@gabrielwol gabrielwol added this to the Miovision pipeline updates milestone Jul 4, 2024
@@ -26,18 +44,19 @@ JOIN miovision_api.intersections AS i USING (intersection_uid)
--find last week volume
LEFT JOIN miovision_api.volumes AS v
ON ar.intersection_uid = v.intersection_uid
--volume within the last 7 days and after AR started
AND v.datetime_bin >= ar.range_start
Copy link
Collaborator

Choose a reason for hiding this comment

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

so for example if we run this today, and the range was add yesterday,
the sum volume for last_week_volume would be summing up only 1 day of data

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, because we wouldn't want to know the volume from before range_start, which would either be zero, or non-zero from a time before the issue started. I could rename it/change it to average daily volume if you think that's better?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yess, to reduce confusion if that ever happens

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Decided to explain it with a column comment and also in the check_open_anomalous_ranges airflow alert.

Copy link
Collaborator

@chmnata chmnata left a comment

Choose a reason for hiding this comment

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

:gabe-approved:

@chmnata chmnata merged commit d659643 into master Jul 12, 2024
5 of 6 checks passed
@chmnata
Copy link
Collaborator

chmnata commented Jul 12, 2024

Updated miovision_api.open_issues

@gabrielwol gabrielwol deleted the 949-missing-leg-in-miovisionopen_issues-join branch July 19, 2024 17:46
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.

Missing leg in miovision.open_issues join to anomalous_ranges
2 participants