From 38e6461a8afbd7cb83709ddb998f03d40ba87755 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 23 Jan 2024 06:06:14 +0100 Subject: Merging upstream version 20.9.0. Signed-off-by: Daniel Baumann --- sqlglot/executor/env.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sqlglot/executor') diff --git a/sqlglot/executor/env.py b/sqlglot/executor/env.py index b79a551..6c01edc 100644 --- a/sqlglot/executor/env.py +++ b/sqlglot/executor/env.py @@ -132,11 +132,10 @@ def ordered(this, desc, nulls_first): @null_if_any def interval(this, unit): - unit = unit.lower() - plural = unit + "s" + plural = unit + "S" if plural in Generator.TIME_PART_SINGULARS: unit = plural - return datetime.timedelta(**{unit: float(this)}) + return datetime.timedelta(**{unit.lower(): float(this)}) @null_if_any("this", "expression") @@ -176,6 +175,7 @@ ENV = { "DOT": null_if_any(lambda e, this: e[this]), "EQ": null_if_any(lambda this, e: this == e), "EXTRACT": null_if_any(lambda this, e: getattr(e, this)), + "GETPATH": null_if_any(lambda this, e: this.get(e)), "GT": null_if_any(lambda this, e: this > e), "GTE": null_if_any(lambda this, e: this >= e), "IF": lambda predicate, true, false: true if predicate else false, -- cgit v1.2.3