Skip to content

Incorrect since: datetime argument handling #87

Open
@ntarocco

Description

@ntarocco

The since param (and maybe other datetime params?) is incorrectly handled. This was introduced this PR.

Such param is correctly stored as datetime obj in the DB. However:

  1. when dumping the JSON response to the client, it is converted to a str way too early, see here.
  2. when loading, there might be issues with its conversion to Python datetime obj, making it difficult to use, to be checked. There are some UI issues related to this.

There are 2 main issue with the first point:

  • A developer implementing a new job cannot easily use it.
  • Given that the root cause of a datetime conversion stack trace was not fully understood, a cast to str was added everywhere and it should be removed.

When fixed, the instances of str(since) should disappear from any job implementation.
Another example to test (and probably fix): inveniosoftware/invenio-vocabularies#494

And now, it is also in the doc 👀 👀 👀 👀 👀 👀 👀

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    In review 🔍

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions