-
Notifications
You must be signed in to change notification settings - Fork 67
Leonlu2/time values and issues #1065
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
Changes from 8 commits
9e3ad67
d08c011
9b50619
2d1ad93
9b1eaeb
2a13311
3f2bacb
269b294
79e32dc
c53c15a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -381,7 +381,10 @@ def _parse_range(part: str): | |||||||||||||||||||||
def parse_date(s: str) -> int: | ||||||||||||||||||||||
# parses a given string in format YYYYMMDD or YYYY-MM-DD to a number in the form YYYYMMDD | ||||||||||||||||||||||
try: | ||||||||||||||||||||||
return int(s.replace("-", "")) | ||||||||||||||||||||||
if s == "*": | ||||||||||||||||||||||
return s | ||||||||||||||||||||||
else: | ||||||||||||||||||||||
return int(s.replace("-", "")) | ||||||||||||||||||||||
Comment on lines
383
to
+387
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
the |
||||||||||||||||||||||
except ValueError: | ||||||||||||||||||||||
raise ValidationFailedException(f"not a valid date: {s}") | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
@@ -477,6 +480,8 @@ def parse_time_set() -> TimeSet: | |||||||||||||||||||||
# old version | ||||||||||||||||||||||
require_all("time_type", "time_values") | ||||||||||||||||||||||
time_values = extract_dates("time_values") | ||||||||||||||||||||||
if len(time_values) == 1 and time_values[0] == "*": | ||||||||||||||||||||||
LeonLu2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||
return TimeSet(time_type, True) | ||||||||||||||||||||||
return TimeSet(time_type, time_values) | ||||||||||||||||||||||
|
||||||||||||||||||||||
if ":" not in request.values.get("time", ""): | ||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -474,8 +474,11 @@ def apply_lag_filter(self, history_table: str, lag: Optional[int]) -> "QueryBuil | |||||||||||||||||
|
||||||||||||||||||
def apply_issues_filter(self, history_table: str, issues: Optional[TimeValues]) -> "QueryBuilder": | ||||||||||||||||||
if issues: | ||||||||||||||||||
self.retable(history_table) | ||||||||||||||||||
self.where_integers("issue", issues) | ||||||||||||||||||
if issues == ["*"]: | ||||||||||||||||||
self.retable(history_table) | ||||||||||||||||||
else: | ||||||||||||||||||
self.retable(history_table) | ||||||||||||||||||
self.where_integers("issue", issues) | ||||||||||||||||||
Comment on lines
+477
to
+481
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
you dont have to repeat the |
||||||||||||||||||
return self | ||||||||||||||||||
|
||||||||||||||||||
def apply_as_of_filter(self, history_table: str, as_of: Optional[int]) -> "QueryBuilder": | ||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.