-
Notifications
You must be signed in to change notification settings - Fork 99
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
Support for join_to_timespine
metrics with custom grain in the group by
#1505
Conversation
c38c05d
to
c777a36
Compare
c777a36
to
bc04559
Compare
@@ -0,0 +1,17 @@ | |||
booking__ds__martian_day bookings_join_to_time_spine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the expected result. All of the bookings
source data maps to this martian_day
.
for grain, time_spine_source in time_spine_sources.items() | ||
if grain.to_int() <= smallest_required_standard_grain.to_int() | ||
} | ||
if not compatible_time_spines_for_standard_grains: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - non-blocking: I kinda like the readability of doing
if compatible_time_spines_for_standard_grains == {}:
# OR
if len(compatible_time_spines_for_standard_grains) == 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call you have given me this feedback before, I'll try to remember in future!!
|
||
# If the standard grains can't be satisfied by the same time spines as the custom grains, add the largest compatible one. | ||
if not required_time_spines.intersection(set(compatible_time_spines_for_standard_grains.values())): | ||
required_time_spines.add(time_spine_sources[max(compatible_time_spines_for_standard_grains.keys())]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you don't need .keys()
since it already uses keys by default when you do any functions on a dict.
Support for using custom grains in the group by when querying
join_to_timespine
metrics.This includes only limited support for now. Later we will support:
JoinToTimeSpineNode