You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working with DataFrames often means passing them through multiple transformation functions, making it easy to lose track of their structure over time. DAFFY adds runtime validation and documentation to your DataFrame operations through simple decorators. By declaring the expected columns and types in your function definitions, you can:
10
10
@@ -35,7 +35,7 @@ Install with your favorite Python dependency manager like
35
35
pip install daffy
36
36
```
37
37
38
-
## Usage
38
+
## Usage
39
39
40
40
Start by importing the needed decorators:
41
41
@@ -127,6 +127,27 @@ will, when `car_df` contains columns `["Brand", "Price"]` raise an error:
You can set the default value for strict mode at the project level by adding a `[tool.daffy]` section to your `pyproject.toml` file:
133
+
134
+
```toml
135
+
[tool.daffy]
136
+
strict = true
137
+
```
138
+
139
+
When this configuration is present, all `@df_in` and `@df_out` decorators will use strict mode by default. You can still override this setting on individual decorators:
140
+
141
+
```python
142
+
# Uses strict=true from project config
143
+
@df_in(columns=["Brand"])
144
+
# Explicitly disable strict mode for this decorator
0 commit comments