This commit is contained in:
2021-10-29 08:14:23 +01:00
parent c0879efa7f
commit 01b6c2baac
16 changed files with 496 additions and 16 deletions

43
Facebook/bento_pvc.md Normal file
View File

@@ -0,0 +1,43 @@
# To Read
[4 PVC tips that will make you more productive](https://fb.workplace.com/notes/4516377471737510/)
[]()
# Code
### Imports
`from bento import wait`
```
import pandas as pd
import numpy as np
```
`from fblearner.flow.api import types`
### DS
```
from datetime import date, timedelta
ds = date.today() - timedelta(days=1)
```
or use
```
from fblearner.flow.projects.pvc.date import (
day, week,
today, yesterday,
date_range,
latest_ds,
)
# All partitions from two weeks ago to the latest having landed
dataset = Dataset(
namespace="some_namespace",
table="some_table",
partition=dict(
ds=date_range(
today() - 2 * week,
latest_ds("some_namespace", "some_table"),
),
),
)
```