Skip to content

Commit efcbd17

Browse files
🐛 Fix impression share request payload
Remove unsupported fields from impression share report request: - returnRecordsWithNoMetrics - returnRowTotals - returnGrandTotals Custom reports use a simpler payload structure than standard reports.
1 parent 8b78c24 commit efcbd17

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

asa_api_client/resources/custom_reports.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ def create_impression_share(
247247
granularity: GranularityType = GranularityType.DAILY,
248248
date_range: ImpressionShareDateRange | None = None,
249249
country_codes: builtins.list[str] | None = None,
250-
return_records_with_no_metrics: bool = True,
251250
) -> ImpressionShareReport:
252251
"""Create a new impression share report.
253252
@@ -261,7 +260,6 @@ def create_impression_share(
261260
granularity: DAILY or WEEKLY (WEEKLY requires date_range).
262261
date_range: Required for WEEKLY granularity (LAST_WEEK, LAST_2_WEEKS, LAST_4_WEEKS).
263262
country_codes: Optional list of country codes to filter by.
264-
return_records_with_no_metrics: Include keywords with no impressions.
265263
266264
Returns:
267265
The created report (check state for completion status).
@@ -279,9 +277,6 @@ def create_impression_share(
279277
"startTime": start_date.isoformat(),
280278
"endTime": end_date.isoformat(),
281279
"granularity": granularity.value,
282-
"returnRecordsWithNoMetrics": return_records_with_no_metrics,
283-
"returnRowTotals": False,
284-
"returnGrandTotals": False,
285280
}
286281

287282
if date_range:
@@ -311,7 +306,6 @@ async def create_impression_share_async(
311306
granularity: GranularityType = GranularityType.DAILY,
312307
date_range: ImpressionShareDateRange | None = None,
313308
country_codes: builtins.list[str] | None = None,
314-
return_records_with_no_metrics: bool = True,
315309
) -> ImpressionShareReport:
316310
"""Create a new impression share report asynchronously.
317311
@@ -322,7 +316,6 @@ async def create_impression_share_async(
322316
granularity: DAILY or WEEKLY.
323317
date_range: Required for WEEKLY granularity.
324318
country_codes: Optional list of country codes to filter by.
325-
return_records_with_no_metrics: Include keywords with no impressions.
326319
327320
Returns:
328321
The created report.
@@ -332,9 +325,6 @@ async def create_impression_share_async(
332325
"startTime": start_date.isoformat(),
333326
"endTime": end_date.isoformat(),
334327
"granularity": granularity.value,
335-
"returnRecordsWithNoMetrics": return_records_with_no_metrics,
336-
"returnRowTotals": False,
337-
"returnGrandTotals": False,
338328
}
339329

340330
if date_range:
@@ -446,7 +436,6 @@ def get_impression_share(
446436
granularity: GranularityType = GranularityType.DAILY,
447437
date_range: ImpressionShareDateRange | None = None,
448438
country_codes: builtins.list[str] | None = None,
449-
return_records_with_no_metrics: bool = True,
450439
poll_interval: float = 2.0,
451440
timeout: float = 300.0,
452441
) -> ImpressionShareReport:
@@ -462,7 +451,6 @@ def get_impression_share(
462451
granularity: DAILY or WEEKLY.
463452
date_range: Required for WEEKLY granularity.
464453
country_codes: Optional list of country codes to filter by.
465-
return_records_with_no_metrics: Include keywords with no impressions.
466454
poll_interval: Seconds between status checks.
467455
timeout: Maximum seconds to wait.
468456
@@ -491,7 +479,6 @@ def get_impression_share(
491479
granularity=granularity,
492480
date_range=date_range,
493481
country_codes=country_codes,
494-
return_records_with_no_metrics=return_records_with_no_metrics,
495482
)
496483

497484
return self.wait_for_report(
@@ -509,7 +496,6 @@ async def get_impression_share_async(
509496
granularity: GranularityType = GranularityType.DAILY,
510497
date_range: ImpressionShareDateRange | None = None,
511498
country_codes: builtins.list[str] | None = None,
512-
return_records_with_no_metrics: bool = True,
513499
poll_interval: float = 2.0,
514500
timeout: float = 300.0,
515501
) -> ImpressionShareReport:
@@ -522,7 +508,6 @@ async def get_impression_share_async(
522508
granularity: DAILY or WEEKLY.
523509
date_range: Required for WEEKLY granularity.
524510
country_codes: Optional list of country codes to filter by.
525-
return_records_with_no_metrics: Include keywords with no impressions.
526511
poll_interval: Seconds between status checks.
527512
timeout: Maximum seconds to wait.
528513
@@ -536,7 +521,6 @@ async def get_impression_share_async(
536521
granularity=granularity,
537522
date_range=date_range,
538523
country_codes=country_codes,
539-
return_records_with_no_metrics=return_records_with_no_metrics,
540524
)
541525

542526
return await self.wait_for_report_async(

0 commit comments

Comments
 (0)