Skip to content

Commit ec49a5a

Browse files
committed
edit
1 parent 635b74a commit ec49a5a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Examples/data_schema/schema_check.ipynb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"\n",
1111
"It turns out it is quite simple to add such functionality using Python decorators. This isn't particularly useful for general functions (such as `pd.merge()`), where the function is supposed to support arbitrary data schema. However, it can be *very* useful in adding checks and safety to specific applications and analysis workflows built on top such generic functions. In fact, it is a good way to copy schema details from external data sources such as databases or CSV into enforced application invariants. Application code that transforms fixed tables into expected exported results can benefit greatly from schema documentation and enforcement.\n",
1212
"\n",
13+
"I propose a simple check criteria for both function signatures and data frames that applies to both inputs and outputs:\n",
14+
"\n",
15+
" * Data must have *at least* the set of argument names or column names specified.\n",
16+
" * Each column must *no more* types (for non-null values) than the types specified.\n",
17+
"\n",
1318
"In this note I will demonstrate the how to add schema documentation and enforcement to Python functions working over data frames using Python decorators.\n",
1419
"\n",
1520
"Let's import our modules."

0 commit comments

Comments
 (0)