Skip to content

Firestore/pipelines#276

Draft
demolaf wants to merge 4 commits into
mainfrom
firestore/pipelines
Draft

Firestore/pipelines#276
demolaf wants to merge 4 commits into
mainfrom
firestore/pipelines

Conversation

@demolaf
Copy link
Copy Markdown
Member

@demolaf demolaf commented May 15, 2026

No description provided.

@demolaf demolaf marked this pull request as draft May 15, 2026 14:47
Copy link
Copy Markdown
Contributor

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

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 implements the Firestore Pipelines API, introducing a framework for complex, multi-stage data transformations and aggregations. The changes include a comprehensive set of new classes for expressions, aggregate functions, and pipeline stages, as well as integration into the Transaction API and a new usage example. Feedback from the review identifies an unnecessary empty file that should be removed and suggests adding a validation check to the rawStage method to prevent potential runtime errors when handling empty input data.

@@ -0,0 +1 @@

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

This file is empty and appears to be unnecessary. Please remove it.

Comment on lines +457 to +462
Pipeline rawStage(Map<String, dynamic> data) {
return Pipeline._(
firestore: firestore,
stages: [..._stages, _RawStage(data)],
);
}
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 rawStage method does not validate that the data map is non-empty. Passing an empty map will cause a StateError in _stageToProto when accessing data.keys.first. Please add a validation check.

Suggested change
Pipeline rawStage(Map<String, dynamic> data) {
return Pipeline._(
firestore: firestore,
stages: [..._stages, _RawStage(data)],
);
}
Pipeline rawStage(Map<String, dynamic> data) {
if (data.isEmpty) {
throw ArgumentError('Raw stage data cannot be empty');
}
return Pipeline._(
firestore: firestore,
stages: [..._stages, _RawStage(data)],
);
}

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.

1 participant