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 92fdce4 commit dbcdd1f
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 47 deletions.
5 changes: 5 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Avro
BigTable
Bitwise
Bytewax
bools
Ceil
ceil
Concat
Expand Down Expand Up @@ -204,6 +205,7 @@ datasets
datastore
datastores
datetime
datetimes
dateutil
deprovision
deprovisioning
Expand Down Expand Up @@ -291,6 +293,7 @@ noqa
np
nullable
observability
optionals
onboarding
oneof
onwards
Expand Down Expand Up @@ -352,6 +355,7 @@ sts
subnets
tiering
timeframes
timezones
Typeof
typeof
TODO
Expand All @@ -367,6 +371,7 @@ uncomment
unhashable
unidirectionally
unittest
unix
upsert
uptime
uptimes
Expand Down
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
16 changes: 9 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,18 @@ 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 dbcdd1f

Please sign in to comment.