forked from ArjanCodes/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaltered_schema.py
113 lines (112 loc) · 2.85 KB
/
altered_schema.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
from pandera import Check, Column, DataFrameSchema
schema = DataFrameSchema(
columns={
"InvoiceNo": Column(
dtype="str", # Changed
checks=None,
nullable=False,
unique=False,
coerce=False,
required=True,
regex=False,
description=None,
title=None,
),
"StockCode": Column(
dtype="str", # Changed
checks=None,
nullable=False,
unique=False,
coerce=False,
required=True,
regex=False,
description=None,
title=None,
),
"Description": Column(
dtype="str", # Changed
checks=None,
nullable=True, # Changed
unique=False,
coerce=False,
required=True,
regex=False,
description=None,
title=None,
),
"Quantity": Column(
dtype="int64",
checks=[
Check.greater_than_or_equal_to(min_value=1),
# Removed this Check
],
nullable=False,
unique=False,
coerce=False,
required=True,
regex=False,
description=None,
title=None,
),
"InvoiceDate": Column(
dtype="datetime", # Changed
checks=None,
nullable=False,
unique=False,
coerce=False,
required=True,
regex=False,
description=None,
title=None,
),
"UnitPrice": Column(
dtype="float64",
checks=[
Check.greater_than_or_equal_to(min_value=0.01),
# Removed this Check
],
nullable=False,
unique=False,
coerce=False,
required=True,
regex=False,
description=None,
title=None,
),
"CustomerID": Column(
dtype="float64",
# Removed all Checks (makes no sense)
checks=None,
nullable=False,
unique=False,
coerce=False,
required=True,
regex=False,
description=None,
title=None,
),
"Country": Column(
dtype="str", # Changed
checks=None,
nullable=False,
unique=False,
coerce=False,
required=True,
regex=False,
description=None,
title=None,
),
},
checks=None,
# Removed Index checks (makes no sense)
dtype=None,
coerce=True,
strict=False,
name=None,
ordered=False,
unique=None,
report_duplicates="all",
unique_column_names=False,
title=None,
description=None,
)