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.
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.