tempo
tempo copied to clipboard
IntervalsDF initialization method doesn't match description
The IntervalsDF class talks about a metrics
paramater that should be defined, but this is not present in the current api.
If I try to run the example code under disjoint (after replacing the Nulls with None):
df = spark.createDataFrame(
[["2020-08-01 00:00:10", "2020-08-01 00:00:14", "v1", 5, None],
["2020-08-01 00:00:09", "2020-08-01 00:00:11", "v1", None, 0]],
"start_ts STRING, end_ts STRING, series_1 STRING, metric_1 STRING, metric_2 INT",
)
idf = IntervalsDF(df, "start_ts", "end_ts", ["series_1"], ["metric_1", "metric_2"])
idf.disjoint().df.collect()
I get the following error:
TypeError: __init__() takes from 4 to 5 positional arguments but 6 were given
Thanks for opening this. We made an update to infer the metrics instead of having the user pass them as an argument and missed updating the docs
If you update the call to create idf
to the below it should work:
idf = IntervalsDF(df, "start_ts", "end_ts", ["series_1"])
I plan to address this as part of the PR for #268