<filename>app/tests/manual/elastic_time_range_test.py
import asyncio
from pprint import pprint

from app.domain.index import Index
from app.domain.time_range_query import DatetimeRangePayload


async def main():
    a = {
        "minDate": {
            "delta": {
                "entity": "month",
                "value": -3,
            }
        }
    }
    q = DatetimeRangePayload(**a)
    es = Index("session")
    r = await es.histogram(q)
    pprint(r)

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
<filename>app/tests/manual/elastic_time_range_test.py
import asyncio
from pprint import pprint

from app.domain.index import Index
from app.domain.time_range_query import DatetimeRangePayload


async def main():
    a = {
        "minDate": {
            "delta": {
                "entity": "month",
                "value": -3,
            }
        }
    }
    q = DatetimeRangePayload(**a)
    es = Index("session")
    r = await es.histogram(q)
    pprint(r)

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()