Skip to content

deleteApi has a problem with OffsetDateTime.MIN , OffsetDateTime.MAX #128

@patrick-schweizer

Description

@patrick-schweizer

Given:

DeletePredicateRequest predicate = new DeletePredicateRequest()
    .start( OffsetDateTime.MIN)
    .stop(OffsetDateTime.MAX)
    .predicate("...");
deleteApi.delete(predicate, configBucket, configOrg);

will result in

com.influxdb.exceptions.BadRequestException: invalid request; error parsing request json: invalid RFC3339Nano for field stop, please format your time with RFC3339Nano format, example: 2009-01-01T23:00:00Z

	at com.influxdb.internal.AbstractRestClient.responseToError(AbstractRestClient.java:96)
	at com.influxdb.internal.AbstractRestClient.execute(AbstractRestClient.java:81)
	at com.influxdb.client.internal.DeleteApiImpl.delete(DeleteApiImpl.java:108)

whereas

        DeletePredicateRequest predicate = new DeletePredicateRequest()
                .start(OffsetDateTime.now().minusMinutes(30))
                .stop(OffsetDateTime.now())
                .predicate("...");
        deleteApi.delete(predicate, configBucket, configOrg);

works.

Expected behavior:
Either the request can be executed or the error message should indicate the specific problem (I assume the range might be out of bounds).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions