@@ -716,7 +716,7 @@ def test_async_aggreation_to_pipeline_sum(field, in_alias, out_alias):
716716 query = make_async_query (parent )
717717 aggregation_query = make_async_aggregation_query (query )
718718 aggregation_query .sum (field , alias = in_alias )
719- pipeline = aggregation_query .pipeline ()
719+ pipeline = aggregation_query ._build_pipeline ( client . pipeline () )
720720 assert isinstance (pipeline , AsyncPipeline )
721721 assert len (pipeline .stages ) == 2
722722 assert isinstance (pipeline .stages [0 ], Collection )
@@ -747,7 +747,7 @@ def test_async_aggreation_to_pipeline_avg(field, in_alias, out_alias):
747747 query = make_async_query (parent )
748748 aggregation_query = make_async_aggregation_query (query )
749749 aggregation_query .avg (field , alias = in_alias )
750- pipeline = aggregation_query .pipeline ()
750+ pipeline = aggregation_query ._build_pipeline ( client . pipeline () )
751751 assert isinstance (pipeline , AsyncPipeline )
752752 assert len (pipeline .stages ) == 2
753753 assert isinstance (pipeline .stages [0 ], Collection )
@@ -778,7 +778,7 @@ def test_async_aggreation_to_pipeline_count(in_alias, out_alias):
778778 query = make_async_query (parent )
779779 aggregation_query = make_async_aggregation_query (query )
780780 aggregation_query .count (alias = in_alias )
781- pipeline = aggregation_query .pipeline ()
781+ pipeline = aggregation_query ._build_pipeline ( client . pipeline () )
782782 assert isinstance (pipeline , AsyncPipeline )
783783 assert len (pipeline .stages ) == 2
784784 assert isinstance (pipeline .stages [0 ], Collection )
@@ -803,7 +803,7 @@ def test_aggreation_to_pipeline_count_increment():
803803 aggregation_query = make_async_aggregation_query (query )
804804 for _ in range (n ):
805805 aggregation_query .count ()
806- pipeline = aggregation_query .pipeline ()
806+ pipeline = aggregation_query ._build_pipeline ( client . pipeline () )
807807 aggregate_stage = pipeline .stages [1 ]
808808 assert len (aggregate_stage .accumulators ) == n
809809 for i in range (n ):
@@ -822,7 +822,7 @@ def test_async_aggreation_to_pipeline_complex():
822822 aggregation_query .count ()
823823 aggregation_query .avg ("other" )
824824 aggregation_query .sum ("final" )
825- pipeline = aggregation_query .pipeline ()
825+ pipeline = aggregation_query ._build_pipeline ( client . pipeline () )
826826 assert isinstance (pipeline , AsyncPipeline )
827827 assert len (pipeline .stages ) == 3
828828 assert isinstance (pipeline .stages [0 ], Collection )
0 commit comments