Skip to content

Documentation error: model.add_labels() example uses string instead of Formula #116

Description

@tronmon

In the Python API documentation, the example for model.add_labels() uses:

model.add_labels({
'Smokes': {
'Ivan': Fact.TRUE,
'Nick': Fact.TRUE}
})

However, running this code raises:
AttributeError: 'str' object has no attribute 'formula_number'

It appears that model.add_labels() expects a Formula object (e.g., Smokes), not a string.

Replacing:
'Smokes'

With
Smokes

resolves the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions