Skip to content

Commit

Permalink
Clean up docs and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuhuishishishi committed Nov 29, 2020
1 parent baffbcd commit 95be7ab
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions dask_sql/physical/rex/core/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def of(self, op: "Operation") -> "Operation":
class PredicteBasedOperation(Operation):
"""
Helper operation to call a function on the input,
depending if the first arg evaluates, given a predicate function, to true or not
depending if the first arg evaluates, given a predicate function, to true or false
"""
def __init__(self, predicte: Callable, true_route: Callable, false_route: Callable):
super().__init__(self.apply)
Expand Down Expand Up @@ -423,6 +423,9 @@ def extract(self, what, df: SeriesOrScalar):


class CeilFloorOperation(PredicteBasedOperation):
"""
Apply ceil/floor operations on a series depending on its dtype (datetime like vs normal)
"""

def __init__(self, round_method: str):
assert round_method in {
Expand Down Expand Up @@ -546,14 +549,10 @@ class RexCallPlugin(BaseRexPlugin):
"current_time": Operation(lambda *args: pd.Timestamp.now()),
"current_date": Operation(lambda *args: pd.Timestamp.now()),
"current_timestamp": Operation(lambda *args: pd.Timestamp.now()),
# "timestampadd":
# "timestampdiff":
"last_day": TensorScalarOperation(
lambda x: x + pd.tseries.offsets.MonthEnd(1),
lambda x: pd.to_datetime(x) + pd.tseries.offsets.MonthEnd(1)
),
# "date_floor":
# "date_ceil":
}

def convert(
Expand Down

0 comments on commit 95be7ab

Please sign in to comment.