I am using ibis with the bigquery backend.
I want to add a time interval to a date, using the .add() method.
However I can't figured out how to specify such a time interval: the "which_type_here" variable in the code below.
Thanks for your help!
import ibis
import ibis_bigquery
import pandas as pd
import datetime as dt
my_project = "your_poject"
my_dataset = 'your_dataset'
conn = ibis_bigquery.connect(
project_id=my_project,
dataset_id=my_dataset)
pdf = pd.DataFrame({'date': [dt.date(2020, 1, 1),
dt.date(2020, 5, 19),
dt.date(2021, 7, 9)],
})
client = bigquery.Client(project=my_project)
table = my_dataset + ".mytable"
client.delete_table(table, not_found_ok=True)
job = client.load_table_from_dataframe(pdf, table)
t = conn.table("mytable")
which_type_here = ????
e = t.mutate(new_date=t.date.add(which_type_here))