Skip to content

Schema with Object TTL, after exported, is not importable. #1957

@dudanogueira

Description

@dudanogueira

This will Fail:

from weaviate.classes.config import Configure

client.connect()
client.collections.delete("Test")

collection = client.collections.create(
    name="Test",
    object_ttl_config=Configure.ObjectTTL.delete_by_creation_time(
        time_to_live=60,
        filter_expired_objects=True
    ),
)

client.collections.delete("NewSchema")
new_schema = collection.config.get().to_dict()
new_schema["class"] = "NewTest"
client.collections.create_from_dict(new_schema)

with

UnexpectedStatusCodeError: Collection may not have been created properly.! Unexpected status code: 422, with response body: {'error': [{'message': 'ObjectTTLConfig: property "creationTime" set as "deleteOn" not found among collection properties'}]}.

This because the to_dict of the _ObjectTTLConfig is not yielding _creationTimeUnix nor _lastUpdateTimeUnix

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