Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/google/cloud/firestore_v1/types/aggregation_result.py: 89%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

9 statements  

1# -*- coding: utf-8 -*- 

2# Copyright 2025 Google LLC 

3# 

4# Licensed under the Apache License, Version 2.0 (the "License"); 

5# you may not use this file except in compliance with the License. 

6# You may obtain a copy of the License at 

7# 

8# http://www.apache.org/licenses/LICENSE-2.0 

9# 

10# Unless required by applicable law or agreed to in writing, software 

11# distributed under the License is distributed on an "AS IS" BASIS, 

12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

13# See the License for the specific language governing permissions and 

14# limitations under the License. 

15# 

16from __future__ import annotations 

17 

18from typing import MutableMapping, MutableSequence 

19 

20import proto # type: ignore 

21 

22from google.cloud.firestore_v1.types import document 

23 

24 

25__protobuf__ = proto.module( 

26 package="google.firestore.v1", 

27 manifest={ 

28 "AggregationResult", 

29 }, 

30) 

31 

32 

33class AggregationResult(proto.Message): 

34 r"""The result of a single bucket from a Firestore aggregation query. 

35 

36 The keys of ``aggregate_fields`` are the same for all results in an 

37 aggregation query, unlike document queries which can have different 

38 fields present for each result. 

39 

40 Attributes: 

41 aggregate_fields (MutableMapping[str, google.cloud.firestore_v1.types.Value]): 

42 The result of the aggregation functions, ex: 

43 ``COUNT(*) AS total_docs``. 

44 

45 The key is the 

46 [alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias] 

47 assigned to the aggregation function on input and the size 

48 of this map equals the number of aggregation functions in 

49 the query. 

50 """ 

51 

52 aggregate_fields: MutableMapping[str, document.Value] = proto.MapField( 

53 proto.STRING, 

54 proto.MESSAGE, 

55 number=2, 

56 message=document.Value, 

57 ) 

58 

59 

60__all__ = tuple(sorted(__protobuf__.manifest))