Categories
Articles

What’s new in atoti version 0.7.0?

As always, we’re working hard to deliver a great product. Check out our breaking updates in this latest release.

On Tuesday, August 16, we released version 0.7.0 of atoti! If you have not had a chance to read about the changes in our changelog, we’ll go through a select subset of changes here. For a complete list of changes, please visit our changelog.

Breaking Changes

If you’re using atoti.scope.cumulative(), you’ll want to pay attention to this.

We’ve updated the behavior of atoti.scope.cumulative()’s time window parameter to align with Pandas and Excel’s treatment of a time window.

Note: Scope factory functions are also changing, and thus the below scope argument could be re-written as well. We cover this example briefly in the section further below. Read about this and other deprecated functions under the ‘Deprecated’ header of our changelog.

Previously,

m["Cumulative datetime"] = tt.agg.sum(
    m["contributors.COUNT"],
    scope=tt.scope.cumulative(l["date"], window=("-1D", None)),
)

would sum the data starting from one day ago, up to and including today. Thus it would include two data points.

screenshot of aggregation logic using prior version

Now, to get the same interval of time, update the window to “-2D”.

m["Cumulative datetime"] = tt.agg.sum(
    m["contributors.COUNT"],
    scope=tt.scope.cumulative(l["datetime"], window=("-2D", None)),
)

This results in the following aggregation:

screenshot of aggregation logic using version 0.7.0

Breaking Removals

We’ve talked about several deprecated functions previously. Having deprecated them in previous releases, we’re discontinuing their usage. If you didn’t have a moment to update when they were originally deprecated, you will want to update them before upgrading to version 0.7.0.

You can find a full list of removals in our changelog. A few examples of the breaking removal changes include:

atoti.create_session()

We’ve cleaned up how we instantiate an atoti session in the 0.6.5 release, streamlining to atoti.Session(). In this latest release of 0.7.0, we have dropped atoti.create_session().

atoti.level.Level.comparator

Previously, we could set the order for our levels by setting the comparator to atoti.comparator.ASCENDING, atoti.comparator.DESCENDING, or atoti.comparator.first_members() (for custom ordering). Now, use atoti.NaturalOrder in the place of atoti.comparator.ASCENDING or atoti.comparator.DESCENDING.

And use atoti.CustomOrder in place of atoti.comparator.first_members().

Deprecated Functions

As we mentioned earlier, Scope factory functions are changing. Read about this update and others under the ‘Deprecated’ header of our changelog.

For example, in our earlier example we rewrote our new measure as:


m["Cumulative datetime"] = tt.agg.sum(
    m["contributors.COUNT"],
    scope=tt.scope.cumulative(l["date"], window=("-2D", None)),
)

We can replace atoti.scope.cumulative() with atoti.CumulativeScope(). For atoti.CumulativeScope(), we set our window using “P-2D” notation to indicate the period of the prior two days, aligning with the format Java’s period.parse() method would use.

Conclusion

Thank you for reading. As always, we’re constantly improving atoti. This was a highlight of some of the changes in our latest release latest release, 0.7.0. Have an idea or a question? Join the conversation on GitHub. For a complete list of changes, please visit our changelog.