Skip to content

Commit e5d2e35

Browse files
authored
feat: add date functions to bigframes.bigquery module (googleapis#17514)
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. Towards BigQuery SQL API coverage. 🦕
1 parent 8d66c08 commit e5d2e35

8 files changed

Lines changed: 1462 additions & 0 deletions

File tree

packages/bigframes/bigframes/bigquery/__init__.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,21 @@
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_diff,
134+
date_from_unix_date,
135+
date_sub,
136+
date_trunc,
137+
extract,
138+
format_date,
139+
generate_date_array,
140+
last_day,
141+
parse_date,
142+
unix_date,
143+
)
129144

130145
_functions = [
131146
# approximate aggregate ops
@@ -156,6 +171,20 @@
156171
parse_bignumeric,
157172
parse_numeric,
158173
string,
174+
# date ops
175+
current_date,
176+
date,
177+
date_add,
178+
date_diff,
179+
date_from_unix_date,
180+
date_sub,
181+
date_trunc,
182+
extract,
183+
format_date,
184+
generate_date_array,
185+
last_day,
186+
parse_date,
187+
unix_date,
159188
# datetime ops
160189
unix_micros,
161190
unix_millis,
@@ -240,6 +269,20 @@
240269
"parse_bignumeric",
241270
"parse_numeric",
242271
"string",
272+
# date ops
273+
"current_date",
274+
"date",
275+
"date_add",
276+
"date_diff",
277+
"date_from_unix_date",
278+
"date_sub",
279+
"date_trunc",
280+
"extract",
281+
"format_date",
282+
"generate_date_array",
283+
"last_day",
284+
"parse_date",
285+
"unix_date",
243286
# datetime ops
244287
"unix_micros",
245288
"unix_millis",

0 commit comments

Comments
 (0)