-
Notifications
You must be signed in to change notification settings - Fork 6
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
Scheduled queries google dbm #158
base: dev
Are you sure you want to change the base?
Conversation
@@ -33,7 +33,8 @@ | |||
@click.option("--dbm-request-type", type=click.Choice(POSSIBLE_REQUEST_TYPES), required=True) | |||
@click.option("--dbm-query-id") | |||
@click.option("--dbm-query-title") | |||
@click.option("--dbm-query-frequency", default="ONE_TIME") | |||
@click.option("--dbm-query-frequency", type=click.Choice(POSSIBLE_FREQUENCIES), default="ONE_TIME") | |||
@click.option("--dbm-query-timezone-code", type=click.Choice(POSSIBLE_TIMEZONE_CODES), default="America/New_York") |
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.
Could you add this new option to the documentation ? A small guide on how to use sphinx is available here.
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.
Yes thank you
scheduled_start_date: date, scheduled_end_date: date, frequency: str, date_range: str | ||
): | ||
|
||
if not date_range: |
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.
From what I see it's almost the same code as check_date_range_definition_conformity, is it possible to call this function from the new one by doing the new tests before calling check_date_range_definition_conformity? It should avoid code duplication
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.
The logic is not the same for a scheduled report and for a normal report.
In a normal report, we shouldn't have both a date range and a couple of dates.
In a scheduled report, it is needed.
I could indeed use check_date_range_definition_conformity(scheduled_start_date, scheduled_end_date, None) after my else, but it seems to me that it is a "hack" just to avoid code deduplication that doesn't explain the logic behind the check.
What do you think @AlexisVLRT ?
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.
It seems logical to me, thanks for the explanation
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.
lgtm
The goal of this PR is to enable the creation of scheduled reports for Google DBM reader.
To do so, I added a function that creates the "schedule" body of the query depending on the query request type.
Moreover, I added the the possible values for the timezone codes and the frequencies in cli.py