Skip to content

Error: `TypeError: can't pickle property objects`

This error occurs when a jsonschema is constructed using helper classes, and an ObjectType class is not instantiated with it's subproperties.

TypeError: can't pickle property objects

Example which triggers this:

    schema = PropertiesList(
        Property("active", BooleanType),
        Property("annotation_hotkeys", ObjectType), # << This one needs to be instantiated
        Property("annotators_can_create_tags", BooleanType),
        Property("annotators_can_instantiate_workflows", BooleanType),
    ).to_dict()

From slack: https://meltano.slack.com/archives/C01PKLU5D1R/p1616340560020700

Edited by AJ Steers