Skip to content

Commit

Permalink
poetry: update lock file + changelog, fix mypy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilgarg28 committed Sep 20, 2024
1 parent 7fc2fe9 commit a391cbe
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 47 deletions.
8 changes: 7 additions & 1 deletion fennel/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog

## [1.5.25] - 2024-09-24
## [1.5.26] - 2024-09-19
- Add support for `datetime` literal, timezone to a few datetime expressions
- Improve rendering of some expression related errors
- Add support for list lambdas - filter, map and reduce functions - sum, max,
min, mean, any, all.

## [1.5.25] - 2024-09-19
- Fix unary operator expressions

## [1.5.24] - 2024-09-18
Expand Down
14 changes: 7 additions & 7 deletions fennel/expr/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ class DateTimeFromEpoch(Expr):


@dataclass
class DateTimeLiteral(DateTimeOp):
class DateTimeLiteral(Expr):
year: int
month: int
day: int
Expand All @@ -752,16 +752,16 @@ def parts(self, part: TimeUnit, timezone: Optional[str] = "UTC") -> _Number:
_DateTime(self, DateTimeParts(part, timezone)), MathNoop()
)

def since(self, other: Expr, unit: TimeUnit = "second") -> _Number:
unit = TimeUnit.from_string(unit)
def since(self, other: Expr, unit: str = "second") -> _Number:
time_unit = TimeUnit.from_string(unit)
other_expr = make_expr(other)
return _Number(
_DateTime(self, DateTimeSince(other_expr, unit)), MathNoop()
_DateTime(self, DateTimeSince(other_expr, time_unit)), MathNoop()
)

def since_epoch(self, unit: TimeUnit = "second") -> _Number:
unit = TimeUnit.from_string(unit)
return _Number(_DateTime(self, DateTimeSinceEpoch(unit)), MathNoop())
def since_epoch(self, unit: str = "second") -> _Number:
time_unit = TimeUnit.from_string(unit)
return _Number(_DateTime(self, DateTimeSinceEpoch(time_unit)), MathNoop())

def strftime(self, format: str, timezone: Optional[str] = "UTC") -> _String:
return _String(
Expand Down
78 changes: 39 additions & 39 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a391cbe

Please sign in to comment.