Skip to content

Commit 5d55ebc

Browse files
committed
1. Add code samples to comments
2. Updated Null/Nan semantics for online execution 3. Validate for duplicated aliases 4. Add new functions
1 parent 07892d9 commit 5d55ebc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+6972
-3535
lines changed

firebase-firestore/api.txt

Lines changed: 806 additions & 771 deletions
Large diffs are not rendered by default.

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/AggregationTest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,8 @@ public void testCannotPerformMoreThanMaxAggregations() {
400400

401401
assertThat(e, instanceOf(FirebaseFirestoreException.class));
402402
FirebaseFirestoreException firestoreException = (FirebaseFirestoreException) e;
403-
if (isRunningAgainstEmulator()) {
404-
assertEquals(FirebaseFirestoreException.Code.UNKNOWN, firestoreException.getCode());
405-
} else {
406-
assertEquals(FirebaseFirestoreException.Code.INVALID_ARGUMENT, firestoreException.getCode());
407-
assertTrue(firestoreException.getMessage().contains("maximum number of aggregations"));
408-
}
403+
assertEquals(FirebaseFirestoreException.Code.INVALID_ARGUMENT, firestoreException.getCode());
404+
assertTrue(firestoreException.getMessage().contains("maximum number of aggregations"));
409405
}
410406

411407
@Test

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/PipelineTest.java

Lines changed: 690 additions & 203 deletions
Large diffs are not rendered by default.

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/QueryToPipelineTest.java

Lines changed: 41 additions & 49 deletions
Large diffs are not rendered by default.

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/RealtimePipelineTest.kt

Lines changed: 116 additions & 104 deletions
Large diffs are not rendered by default.

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/testutil/IntegrationTestUtil.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
import com.google.firebase.firestore.FirebaseFirestoreSettings;
3939
import com.google.firebase.firestore.ListenerRegistration;
4040
import com.google.firebase.firestore.MetadataChanges;
41+
import com.google.firebase.firestore.Pipeline;
4142
import com.google.firebase.firestore.PipelineResult;
42-
import com.google.firebase.firestore.PipelineSnapshot;
4343
import com.google.firebase.firestore.Query;
4444
import com.google.firebase.firestore.QuerySnapshot;
4545
import com.google.firebase.firestore.Source;
@@ -468,7 +468,7 @@ public static List<Map<String, Object>> querySnapshotToValues(QuerySnapshot quer
468468
}
469469

470470
public static List<Map<String, Object>> pipelineSnapshotToValues(
471-
PipelineSnapshot pipelineSnapshot) {
471+
Pipeline.Snapshot pipelineSnapshot) {
472472
List<Map<String, Object>> res = new ArrayList<>();
473473
for (PipelineResult result : pipelineSnapshot) {
474474
res.add(result.getData());
@@ -484,7 +484,7 @@ public static List<String> querySnapshotToIds(QuerySnapshot querySnapshot) {
484484
return res;
485485
}
486486

487-
public static List<String> pipelineSnapshotToIds(PipelineSnapshot pipelineResults) {
487+
public static List<String> pipelineSnapshotToIds(Pipeline.Snapshot pipelineResults) {
488488
List<String> res = new ArrayList<>();
489489
for (PipelineResult result : pipelineResults) {
490490
DocumentReference ref = result.getRef();
@@ -597,7 +597,7 @@ public static void checkQueryAndPipelineResultsMatch(Query query, String... expe
597597
} catch (Exception e) {
598598
throw new RuntimeException("Classic Query FAILED", e);
599599
}
600-
PipelineSnapshot docsFromPipeline;
600+
Pipeline.Snapshot docsFromPipeline;
601601
try {
602602
docsFromPipeline = waitFor(query.getFirestore().pipeline().createFrom(query).execute());
603603
} catch (Exception e) {

firebase-firestore/src/main/java/com/google/firebase/firestore/AggregateField.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
package com.google.firebase.firestore;
1616

17-
import static com.google.firebase.firestore.pipeline.Expr.field;
17+
import static com.google.firebase.firestore.pipeline.Expression.field;
1818

1919
import androidx.annotation.NonNull;
2020
import androidx.annotation.Nullable;
@@ -232,7 +232,7 @@ private AverageAggregateField(@NonNull FieldPath fieldPath) {
232232
@NonNull
233233
@Override
234234
AliasedAggregate toPipeline() {
235-
return field(getFieldPath()).avg().alias(getAlias());
235+
return field(getFieldPath()).average().alias(getAlias());
236236
}
237237
}
238238
}

0 commit comments

Comments
 (0)