1
0
Fork 0

Adding upstream version 6.0.4.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 06:15:54 +01:00
parent d01130b3f1
commit 527597d2af
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
122 changed files with 23162 additions and 0 deletions

32
sqlglot/executor/env.py Normal file
View file

@ -0,0 +1,32 @@
import datetime
import re
import statistics
class reverse_key:
def __init__(self, obj):
self.obj = obj
def __eq__(self, other):
return other.obj == self.obj
def __lt__(self, other):
return other.obj < self.obj
ENV = {
"__builtins__": {},
"datetime": datetime,
"locals": locals,
"re": re,
"float": float,
"int": int,
"str": str,
"desc": reverse_key,
"SUM": sum,
"AVG": statistics.fmean if hasattr(statistics, "fmean") else statistics.mean,
"COUNT": lambda acc: sum(1 for e in acc if e is not None),
"MAX": max,
"MIN": min,
"POW": pow,
}