Functions and contracts¶
A function is reusable code with typed arguments and a declared return contract.
Function implementationsa are independent from spec's logical function templates. This makes it possible to keep the spec unthouched while changing the implementation on the background.
Function dataframe signature¶
The inspector derives and validates the number of dataframes an implementation takes as arguments and returns. The Spec stores the logical dataframe contract.
Dataframe counts describe the function data signature, independently of operator bindings, logical features, or internal I/O.
| Dataframes in → out | Semantic label |
|---|---|
| 0 → 1 | read |
| 1 → 1 | transform |
| 1 → 0 | write |
| 2 → 1 | combine |
| x → x | workflow |
The labels are derived as function semantics, and developer does not need to define them by hand.
Dataframe signatures visualized:
Returns a dataframe without receiving a framework-bound dataframe.
Transforms a dataframe into a new dataframe or fragment.
Consumes a dataframe for a side effect, such as a write.
The ignored-result contract does not describe internal dataframe use.
Combines the current dataset with a computed fragment.
Other arguments¶
Functions might have any additional arguments. Spec validation checks declared argument names and types. Binding inspection additionally compares these declarations with implementation parameters and annotations.