Skip to content

Commit 4e2d7b3

Browse files
committed
feat: add date functions to bigframes.bigquery module
Used the following prompt: > Update the descriptions and argument names in scripts/data/sql-functions/global-namespace/date.yaml according to the following SQL documentation: > > (Paste from https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/date_functions) > > Also, if there is a natural argument to use for `series_accessor_arg` in this yaml or others, add it.
1 parent 690c15d commit 4e2d7b3

8 files changed

Lines changed: 2259 additions & 0 deletions

File tree

packages/bigframes/bigframes/bigquery/__init__.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,22 @@
126126
parse_numeric,
127127
string,
128128
)
129+
from bigframes.operations.googlesql.global_namespace.date import (
130+
current_date,
131+
date,
132+
date_add,
133+
date_bucket,
134+
date_diff,
135+
date_from_unix_date,
136+
date_sub,
137+
date_trunc,
138+
extract,
139+
format_date,
140+
generate_date_array,
141+
last_day,
142+
parse_date,
143+
unix_date,
144+
)
129145

130146
_functions = [
131147
# approximate aggregate ops
@@ -156,6 +172,21 @@
156172
parse_bignumeric,
157173
parse_numeric,
158174
string,
175+
# date ops
176+
current_date,
177+
date,
178+
date_add,
179+
date_bucket,
180+
date_diff,
181+
date_from_unix_date,
182+
date_sub,
183+
date_trunc,
184+
extract,
185+
format_date,
186+
generate_date_array,
187+
last_day,
188+
parse_date,
189+
unix_date,
159190
# datetime ops
160191
unix_micros,
161192
unix_millis,
@@ -240,6 +271,21 @@
240271
"parse_bignumeric",
241272
"parse_numeric",
242273
"string",
274+
# date ops
275+
"current_date",
276+
"date",
277+
"date_add",
278+
"date_bucket",
279+
"date_diff",
280+
"date_from_unix_date",
281+
"date_sub",
282+
"date_trunc",
283+
"extract",
284+
"format_date",
285+
"generate_date_array",
286+
"last_day",
287+
"parse_date",
288+
"unix_date",
243289
# datetime ops
244290
"unix_micros",
245291
"unix_millis",

0 commit comments

Comments
 (0)