File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ public function getParametersDefinition(): ArrayNodeDefinition
166166 ->end ()
167167 ->scalarNode ('samplingLevel ' )
168168 ->end ()
169+ ->booleanNode ('keepEmptyRows ' )->defaultTrue ()->end ()
169170 ->end ()
170171 ->end ()
171172 ->scalarNode ('outputTable ' )
Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ private function getPropertyReportRequest(array $query): array
260260 'endDate ' => date ('Y-m-d ' , (int ) strtotime ($ item ['endDate ' ])),
261261 ];
262262 }, $ query ['dateRanges ' ]),
263- 'keepEmptyRows ' => true ,
263+ 'keepEmptyRows ' => $ query [ ' keepEmptyRows ' ] ?? true ,
264264 'dimensions ' => $ query ['dimensions ' ],
265265 'metrics ' => $ query ['metrics ' ],
266266 'offset ' => $ query ['offset ' ] ?? 0 ,
Original file line number Diff line number Diff line change @@ -103,6 +103,21 @@ public function testAddSegmentDimension(): void
103103 $ this ->assertCount (1 , $ dimensions );
104104 }
105105
106+ public function testKeepEmptyRowsDefaultAndCustom (): void
107+ {
108+ // Default value (not set in config)
109+ $ config = $ this ->config ;
110+ unset($ config ['parameters ' ]['query ' ]['keepEmptyRows ' ]);
111+ $ configData = new Config ($ config , new ConfigDefinition ());
112+ $ this ->assertArrayHasKey ('keepEmptyRows ' , $ configData ->getQuery ());
113+ $ this ->assertTrue ($ configData ->getQuery ()['keepEmptyRows ' ]);
114+
115+ // Set to false
116+ $ config ['parameters ' ]['query ' ]['keepEmptyRows ' ] = false ;
117+ $ configData = new Config ($ config , new ConfigDefinition ());
118+ $ this ->assertFalse ($ configData ->getQuery ()['keepEmptyRows ' ]);
119+ }
120+
106121 private function getConfig (string $ suffix = '' ): array
107122 {
108123 $ config = json_decode ((string ) file_get_contents ($ this ->dataDir . '/config ' . $ suffix . '.json ' ), true );
You can’t perform that action at this time.
0 commit comments