-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathexample.py
More file actions
35 lines (28 loc) · 993 Bytes
/
example.py
File metadata and controls
35 lines (28 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from tinytimmy.tinytim import TinyTim
import pandas as pd
import polars as pl
def main():
# CSV example
tm = TinyTim(source_type="csv", file_path="tinytimmy/202306-divvy-tripdata.csv")
results = tm.default_checks()
print(results)
# pandas example
df = pd.read_csv("tinytimmy/202306-divvy-tripdata.csv")
tm = TinyTim(source_type="pandas", dataframe=df)
results = tm.default_checks()
print(results)
# polars example
df = pl.read_csv("tinytimmy/202306-divvy-tripdata.csv", infer_schema_length=10000)
tm = TinyTim(source_type="polars", dataframe=df)
results = tm.default_checks()
print(results)
# customer filter check example
tm = TinyTim(source_type="csv", file_path="tinytimmy/202306-divvy-tripdata.csv")
results = tm.default_checks()
print(results)
results = tm.run_custom_check(
["start_station_name IS NULL", "end_station_name IS NULL"]
)
print(results)
if __name__ == "__main__":
main()