-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Last Observation Carried Forward #7
Comments
Currently something like this will do the trick Metric.
timescale.filter(device=device).filter(time__range=range).values('temperature')
.time_bucket_gapfill('time', '1 day', range[0], range[1], datapoints=1).annotate(Avg('temperature'))
.annotate(locf=Func(F('temperature'), function="locf")).order_by('time') |
This didn't work for me. I tried to run this in a Django shell on Python 3.8.6 and get the following error:
Any idea? |
|
@DoGab As I remember the query above isn't quite there yet, but it's a long time ago since I've played with it. Really looking forward to hear if you can use it or how to do it :) |
@schlunsen Thank you for the Hint. I didn't find the correct library to include. It worked great! I have not tested it with data that are gapped but for now the query already works! |
https://docs.timescale.com/latest/using-timescaledb/reading-data#locf
Should probably be integrated with time_bucket_gapfill
The text was updated successfully, but these errors were encountered: