Error loading numbers into a TEXT Field. Error = invalid text property \'trim\' on class \'test_class\': not a string, but float64")

Hello,

I have successfully created a collection with has a ‘trim’ property with the following attributes: wv_config.Property(name = “trim”, description = “trim”, data_type=wv_config.DataType.TEXT, skip_vectorization=True)

I am loading a pipe delimited file where the content for ‘trim’ = 4531 for a specific record, while other records have both alphanumeric records, several records are numeric only.

During the load process, I continue to receive this error: failed_objs_b = = > [ErrorObject(message=‘WeaviateInsertManyAllFailedError(“Every object failed during insertion. Here is the set of all errors: invalid text property 'trim' on class \test_name': not a string, but float64”)’

Why are text fields not able to load just a number? How can i resolve this error so that a datatype of TEXT can also take numerical values for some records? Also, how can empty data be loaded in. Is there some sort of optional parameter or should it be labeled as ‘N/A’ for TEXT and 0 for FLOAT and INT fields?

Also, what is the absolute character length that TEXT will allow to load in? I know that BLOBS have very large space but I can’t find max limit for TEXT properties.

Also, this was asked before but I am not sure if I understood. How can exact keyword match be done on a field either by query or via filtering? Are there examples you can show me of both scenarios?

Server Setup Information

  • Weaviate Server Version: 1.26.4
  • Multi Node? Number of Running Nodes: Single-node
  • Client Language and Version: Python 3.12
  • Multitenancy?: Single tenancy

Any additional Information:

Full error message:
ERROR:weaviate-client:{‘message’: ‘Failed to send 1 objects in a batch of 1. Please inspect client.batch.failed_objects or collection.batch.failed_objects for the failed objects.’}
{‘message’: ‘Failed to send 1 objects in a batch of 1. Please inspect client.batch.failed_objects or collection.batch.failed_objects for the failed objects.’}
Finished importing 1 articles.
failed_objs_b = = > [ErrorObject(message=‘WeaviateInsertManyAllFailedError(“Every object failed during insertion. Here is the set of all errors: invalid text property 'trim' on class 'test_name': not a string, but float64”)’, object_=_BatchObject(collection=‘test_collection03’, vector=None, uuid=‘1ae67e70-3a8b-4ecd-8f23-a07960a83634’, properties={‘content’: ‘2020 RV Aire’, ‘length_feet’: 44, ‘sleeping_capacity’: 4, ‘gross_weight_lbs’: 54000, ‘weight_class’: ‘Class A’, ‘class_type’: ‘A’, ‘fuel_type’: ‘Diesel’, ‘awnings’: 0, ‘slideouts’: 3, ‘freshwater_cap_gal’: 105, ‘greywater_cap_gal’: 80, ‘blackwater_cap_gal’: 60, ‘address’: ‘1751 Wildwood Dr, Suamico, WI 54173’, ‘stock_no’: ‘18CONS138’, ‘vin’: ‘4VZVU1E91LC086329’, ‘year’: 2020, ‘make’: ‘Newmar’, ‘model’: ‘King Aire’, ‘trim’: 4531, ‘body_type’: ‘RV’, ‘condition’: ‘Used’, ‘exterior_color’: ‘BLACK’, ‘interior_color’: nan, ‘mileage’: 22967, ‘dealership_name’: ‘dealername’, ‘url’: ‘https://testurl.com’, ‘msrp’: 897564, ‘dealer_price’: 149999, ‘price_savings’: 243365, ‘description’: " This Class A motorhome is built on the robust Spartan K3 chassis with a tag axle."}, tenant=None, references=None, index=0, retry_count=0), original_uuid=None)]

hi @Neil !!

Welcome to our community :hugs:

I believe the issue is that you may be passing a number instead of a text.

For example, this will not work:

client.collections.delete("Test")
collection = client.collections.create(
    "Test",
    properties=[
        wvc.config.Property(
            name="text", data_type=wvc.config.DataType.TEXT
        )
    ]
)
collection.data.insert({"text": 4531})

but this insert will work:

collection.data.insert({"text": "4531"})

Let me know if this works for you.

Thanks!