Skip to content

Deprecate store_aggregation and update docs - #3738

Open
p-nowodzinski wants to merge 2 commits into
google:masterfrom
p-nowodzinski:deprecate_store_aggregation
Open

Deprecate store_aggregation and update docs#3738
p-nowodzinski wants to merge 2 commits into
google:masterfrom
p-nowodzinski:deprecate_store_aggregation

Conversation

@p-nowodzinski

Copy link
Copy Markdown

Deprecate store_aggregation() function

Added DeprecationWarning to store_aggregation() and updated notebook demo to remove a reference to calling store_aggregation()

Changed "You can also store your own aggregations using gd_sketch.store_aggregation function" to "You can also store your own aggregations using gd_sketch.save function".

Guides users to use Aggregation.save() instead

@google-cla

google-cla Bot commented Feb 21, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@jkppr
jkppr requested a review from jaegeral February 23, 2026 09:16
@jkppr

jkppr commented Feb 23, 2026

Copy link
Copy Markdown
Collaborator

@jaegeral can you take a look into this?

@jaegeral

Copy link
Copy Markdown
Collaborator

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly deprecates the store_aggregation function in favor of Aggregation.save(), adding a DeprecationWarning as is standard practice. The accompanying documentation update in the demo notebook is also appropriate, but contains a small error in the new instructions. I've left a specific comment with a suggestion to correct the notebook text to accurately guide users on how to use the new method.

Comment thread notebooks/colab-timesketch-demo.ipynb Outdated
"Start by checking out whether there are any stored aggregations that we can just take a look at.\n",
"\n",
"You can also store your own aggregations using the `gd_sketch.store_aggregation` function. However we are not going to do that in this colab."
"You can also store your own aggregations using the `gd_sketch.save` function. However we are not going to do that in this colab."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The updated documentation is slightly incorrect. The Sketch object (gd_sketch) does not have a save method. The deprecation notice for store_aggregation correctly points to using Aggregation.save(). The text should be updated to reflect that the .save() method is on an Aggregation object, not the Sketch object.

Suggested change
"You can also store your own aggregations using the `gd_sketch.save` function. However we are not going to do that in this colab."
"You can also store your own aggregations by calling the `.save()` method on an aggregation object. However we are not going to do that in this colab."

@jaegeral jaegeral left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is okay to not touch the notebook.

"""
if self.is_archived():
raise RuntimeError("Unable to store an aggregator on an archived sketch.")
warnings.warn(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What did we actually gain if you raise a warning instead of a logger message? I think we would be better of to remove the method all together. Or remove the rest of the code.

@jaegeral

Copy link
Copy Markdown
Collaborator

Hey @p-nowodzinski , any thoughts on the PR? I might lean towards just removing the method tbh

@p-nowodzinski

Copy link
Copy Markdown
Author

Hi, apologies for the delayed response and thanks for the feedback.

That makes sense as I initially suggested deprecation in case you preferred to keep the function, but as it doesn’t appear to be used elsewhere, removing it would help simplify the codebase. I'm happy to proceed with removing store_aggregation(). Let me know your preference and I’ll update the PR accordingly.

@jaegeral

Copy link
Copy Markdown
Collaborator

Yeah remove it

@p-nowodzinski
p-nowodzinski force-pushed the deprecate_store_aggregation branch from 20102c3 to 27143a6 Compare April 15, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants