Open
Description
TimescaleDB has the time_bucket
field to take full advantage of their hypertables: https://docs.timescale.com/api/latest/hyperfunctions/time_bucket/
This could be supported with:
class TimeBucketField(MultiField):
def __init__(self, bucket_seconds=60.0, *args, **kwargs):
super().__init__(*args, **kwargs)
self.bucket_seconds = float(bucket_seconds)
self.auto_alias = f"{self.field.name}_bucket"
def get_select_sql(self):
return f"""time_bucket('{self.bucket_seconds:.3f}s',"{self.field.name}")"""
Would this be in the scope of the project?
Metadata
Metadata
Assignees
Labels
No labels