Skip to content

Schema

Here is a list of available actions for Table Schema:

  • check_schema -- check the descriptor against JSON Schema(s)

Reference

dplib.actions.schema.check.check_schema(schema)

Check the validity of a Table Schema descriptor

This validates the descriptor against the JSON Schema profiles to ensure conformity with Data Package standard and Data Package extensions.

Parameters:

Name Type Description Default
schema Union[str, IDict, Schema]

The Table Schema descriptor

required

Returns:

Type Description
List[MetadataError]

A list of errors

Source code in dplib/actions/schema/check.py
def check_schema(schema: Union[str, types.IDict, Schema]) -> List[MetadataError]:
    """Check the validity of a Table Schema descriptor

    This validates the descriptor against the JSON Schema profiles to ensure
    conformity with Data Package standard and Data Package extensions.

    Parameters:
        schema: The Table Schema descriptor

    Returns:
        A list of errors
    """
    if isinstance(schema, Schema):
        schema = schema.to_dict()
    return check_metadata(schema, type="schema")