-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Ppl API #14513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: cheryllin/ppl
Are you sure you want to change the base?
Ppl API #14513
Conversation
Generated by 🚫 Danger |
735b71a
to
3b9ca57
Compare
3b9ca57
to
daf1b68
Compare
bb1bc1c
to
f5f8445
Compare
f5f8445
to
5b2bd88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, some minor nits.
@@ -40,6 +40,20 @@ void Pipeline::execute(util::StatusOrCallback<PipelineSnapshot> callback) { | |||
this->firestore_->RunPipeline(*this, std::move(callback)); | |||
} | |||
|
|||
google_firestore_v1_Value Pipeline::to_proto() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this used?
Serializer::EncodePipeline does the same thing. If you want to move it here, we should update the logic there.
: expr_(std::move(expr)), field_name_(absl::nullopt) { | ||
} | ||
ReplaceWith::ReplaceWith(std::string field_name) | ||
: expr_(nullptr), field_name_(std::move(field_name)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this stage work? I am not sure i understand the implementation. Is it:
- if expr_ is set, and if it is a map, it will replace the input document?
- if field_name_ is set, it is evaluated against the document, and if it is a map it will replace the input document?
: orders_(std::move(orders)) { | ||
} | ||
~SortStage() override = default; | ||
|
||
google_firestore_v1_Pipeline_Stage to_proto() const override; | ||
|
||
private: | ||
std::vector<Ordering> orders_; | ||
std::vector<std::shared_ptr<Ordering>> orders_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a pointer is needed here? I think we only needed if you want polymorphism?
.collection(path: "/foo") | ||
.where(eq(field("foo"), constant("bar"))) | ||
.collection("/foo") | ||
.where(Field("foo") == Constant("bar")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we would move away from operator overload?
"awards": ["hugo": true, "nebula": true], | ||
], | ||
] | ||
|
||
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *) | ||
class PipelineIntegrationTests: FSTIntegrationTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these tests pass locally at least?
|
||
import FirebaseFirestore | ||
|
||
final class PipelineTests: FSTIntegrationTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we need to keep this file around. It serves a purpose as a way to check for compilation errors, but we can just move them to the test below and actually run them.
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
enum Helper { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why an enum instead of a struct or class? Is this a swift convention?
import Foundation | ||
|
||
// TODO: the implementation of `Expr` is not complete | ||
public protocol Expr: Sendable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these should have public documentation, with code samples.
} | ||
} | ||
|
||
/// Adds new fields to outputs from previous stages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe other platforms include code samples of how to use this stage. Please add them here as well.
No description provided.