read_file
Read a Validate object from disk that was previously saved with write_file()
.
USAGE
read_file(filepath)
This function loads a validation object that was previously serialized to disk using the write_file()
function. The validation object will be restored with all its validation results, metadata, and optionally the source data (if it was saved with keep_tbl=True
).
The read_file()
function is currently experimental. Please report any issues you encounter in the Pointblank issue tracker.
Parameters
filepath :
str
|Path
-
The path to the saved validation file. Can be a string or Path object.
Returns
Validate
-
The restored validation object with all its original state, validation results, and metadata.
Examples
Load a validation object that was previously saved:
import pointblank as pb
# Load a validation object from disk
= pb.read_file("my_validation.pkl")
validation
# View the validation results
validation
You can also load using just the filename (without extension):
# This will automatically look for "my_validation.pkl"
= pb.read_file("my_validation") validation
The loaded validation object retains all its functionality:
# Get validation summary
= validation.get_json_report()
summary
# Get sundered data (if original table was saved)
if validation.data is not None:
= validation.get_sundered_data(type="fail") failing_rows
See Also
Use the write_file()
method to save a validation object to disk for later retrieval with this function.