Skip to content

SNOW-2680714 : Fix time_series_agg() correctness and make it GA#4049

Open
sfc-gh-rsureshbabu wants to merge 7 commits intomainfrom
rsureshbabu-SNOW-2680714-timeaggfuncfix
Open

SNOW-2680714 : Fix time_series_agg() correctness and make it GA#4049
sfc-gh-rsureshbabu wants to merge 7 commits intomainfrom
rsureshbabu-SNOW-2680714-timeaggfuncfix

Conversation

@sfc-gh-rsureshbabu
Copy link
Collaborator

@sfc-gh-rsureshbabu sfc-gh-rsureshbabu commented Jan 15, 2026

  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

Fixes SNOW-2680714

  1. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
    • I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: Thread-safe Developer Guidelines
    • If adding any arguments to public Snowpark APIs or creating new public Snowpark APIs, I acknowledge that I have ensured my changes include AST support. Follow the link for more information: AST Support Guidelines
  2. Please describe how your code solves the related issue.

    This PR removes the deprecated sliding_interval parameter from the time_series_agg function in the DataFrameAnalyticsFunctions class. The parameter was previously marked as deprecated in version 1.31.0 and has now been completely removed from the function signature and AST proto definition. The @experimental decorator has also been removed from the function, making it a fully supported API. Tests have been updated to reflect these changes.


return df

@experimental(version="1.12.0")
Copy link
Contributor

Choose a reason for hiding this comment

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

do this deserve a line in the CHANGELOG?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated.

aggs: Dict[str, List[str]],
windows: List[str],
group_by: List[str],
sliding_interval: str = "",
Copy link
Contributor

@sfc-gh-aling sfc-gh-aling Jan 16, 2026

Choose a reason for hiding this comment

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

I'm afraid we can not remove a positional argument easily which is a BCR.
even though this is marked as an experimental feature, but since it's introduced in 1.12.0, people might already use the function in production.

we will have to keep this field until we have a snowpark v2.0 release which can introduce BCRs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Like we discussed offline. This PR doesn't remove the argument. it only fixes the correctness issue and makes it GA for now. we will remove the argument as part of BCR release

repeated string formatted_col_names = 3;
repeated string group_by = 4;
string sliding_interval = 5;
reserved 5; // sliding_interval removed in 1.32.0
Copy link
Contributor

Choose a reason for hiding this comment

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

the ast is defined in the mono repo, and the file here is generated from the mono repo definition.
if we want to remove the field, the updates need to be happen in the mono repo first.

however, as I pointed in the earlier that removing positional argument is a BCR

Copy link
Contributor

@sfc-gh-aling sfc-gh-aling left a comment

Choose a reason for hiding this comment

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

removing positional argument from a public api is a BCR, but the experimental marker can still be removed


@experimental(version="1.12.0")
@publicapi
def time_series_agg(
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious how changing time_series_agg fixes the issue SNOW-2680714. Are we calling this function with the sliding_window_agg or is the customer passing this in?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made recent updates, Please take a look. We will exclude the rows with same timestamp with second granularity.

@sfc-gh-rsureshbabu sfc-gh-rsureshbabu force-pushed the rsureshbabu-SNOW-2680714-timeaggfuncfix branch from 6dcad6f to 3d4218c Compare January 29, 2026 22:58
…t row

Breaking change in v1.45.0:
- Changed window frame to exclude current row to prevent data leakage in ML use cases
- Past windows: now use -interval to 1 PRECEDING (was: -interval to CURRENT ROW)
- Future windows: now use 1 FOLLOWING to interval (was: CURRENT ROW to interval)
- Updated all integration tests with new expected values
- Updated proto file with breaking change comment
- Updated CHANGELOG with breaking change section
@sfc-gh-rsureshbabu sfc-gh-rsureshbabu changed the title SNOW-2680714 : Remove sliding_interval parameter from time_series_agg() SNOW-2680714 : Fix time_series_agg() correctness and make it GA Feb 9, 2026
@sfc-gh-rsureshbabu sfc-gh-rsureshbabu marked this pull request as ready for review February 9, 2026 14:31
@sfc-gh-rsureshbabu sfc-gh-rsureshbabu requested review from a team as code owners February 9, 2026 14:31
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.

4 participants