Skip to content

Commit

Permalink
fix pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie committed Jan 11, 2021
1 parent a08944f commit 9add899
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions superset/connectors/druid/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
from superset.models.helpers import AuditMixinNullable, ImportExportMixin, QueryResult
from superset.typing import FilterValues, Granularity, Metric, QueryObjectDict
from superset.utils import core as utils
from superset.utils.date_parser import parse_human_datetime
from superset.utils.date_parser import parse_human_datetime, parse_human_timedelta

try:
import requests
Expand Down Expand Up @@ -796,7 +796,7 @@ def granularity(
else:
granularity["type"] = "duration"
granularity["duration"] = (
utils.parse_human_timedelta(period_name).total_seconds() # type: ignore
parse_human_timedelta(period_name).total_seconds() # type: ignore
* 1000
)
return granularity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from sqlalchemy.ext.declarative import declarative_base

from superset import db
from superset.utils.core import parse_human_timedelta
from superset.utils.date_parser import parse_human_timedelta

revision = "3dda56f1c4c6"
down_revision = "bddc498dd179"
Expand Down
2 changes: 1 addition & 1 deletion superset/utils/date_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import calendar
import logging
import re
from datetime import date, datetime, timedelta
from datetime import datetime, timedelta
from time import struct_time
from typing import List, Optional, Tuple

Expand Down
6 changes: 3 additions & 3 deletions superset/viz_sip38.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
merge_extra_filters,
to_adhoc,
)
from superset.utils.date_parser import get_since_until
from superset.utils.date_parser import get_since_until, parse_past_timedelta

import dataclasses # isort:skip

Expand Down Expand Up @@ -368,7 +368,7 @@ def query_obj(self) -> Dict[str, Any]:
until=form_data.get("until"),
)
time_shift = form_data.get("time_shift", "")
self.time_shift = utils.parse_past_timedelta(time_shift)
self.time_shift = parse_past_timedelta(time_shift)
from_dttm = None if since is None else (since - self.time_shift)
to_dttm = None if until is None else (until - self.time_shift)
if from_dttm and to_dttm and from_dttm > to_dttm:
Expand Down Expand Up @@ -1266,7 +1266,7 @@ def run_extra_queries(self):

for option in time_compare:
query_object = self.query_obj()
delta = utils.parse_past_timedelta(option)
delta = parse_past_timedelta(option)
query_object["inner_from_dttm"] = query_object["from_dttm"]
query_object["inner_to_dttm"] = query_object["to_dttm"]

Expand Down

0 comments on commit 9add899

Please sign in to comment.