ad unit statement error.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Các điểm đầu vào liên quan là report_downloader.WaitForReport và DownloadReportToFile; trước tiên hãy tách riêng câu lệnh reportQuery và các thiết lập adUnitView khỏi bước đọc pandas. Được xem là hoàn tất khi báo cáo đã lọc tạo ra một CSV có thể đọc được với các ad unit ID được yêu cầu thay vì EmptyDataError.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi,
I am trying to run a report by filtering the data with Ad unit ID. However when I set 'adUnitView':'HIERARCHICAL' the code produces zero data. When I remove 'statement': ad_unit_filter_statement, the code works but brings all data of all ad unit IDs.
How can I rewrite the ad_unit_filter_statement?
The error
EmptyDataError: No columns to parse from file
The Code
ad_unit_ids = [1111, 2222]
ad_unit_filter_statement = {
'query': 'WHERE AD_UNIT_ID IN (%s)' % ','.join(map(str, ad_unit_ids))
}
report_job = {
'reportQuery': {
'dimensions': [
'DATE',
'ADVERTISER_ID' ,'ADVERTISER_NAME',
'ORDER_ID' ,'ORDER_NAME',
'LINE_ITEM_ID' ,'LINE_ITEM_NAME',
'AD_UNIT_ID' ,'AD_UNIT_NAME',
'DEVICE_CATEGORY_NAME','DEVICE_CATEGORY_ID'
],
'columns': ['TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS',
'TOTAL_LINE_ITEM_LEVEL_CLICKS',
'TOTAL_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS'
],
'adUnitView':'HIERARCHICAL',
'dateRangeType': 'CUSTOM_DATE',
'startDate': first_date,
'endDate': last_date,
'statement': ad_unit_filter_statement
}
}
report_job_id = report_downloader.WaitForReport(report_job)
export_format = 'CSV_DUMP'
directory='/home/sgocen/git_tree/xxx'
report_file = tempfile.NamedTemporaryFile(suffix='.csv', dir=directory, delete=False)
report_downloader.DownloadReportToFile(report_job_id, export_format, report_file, use_gzip_compression=False)
chunk_size = (16 * 1024) # chunk size used for report downloader
file_size = os.path.getsize(report_file.name)
df_report = pd.read_csv(report_file.name)
report_file.close()
- Ngôn ngữ chính
- Python
- Star
- 749
- Fork
- 967
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của googleads/googleads-python-lib
-
[Bug] Potential Billion Laughs Attack Vector via Unrestricted XML Parsing in `ZeepSchemaHelper` Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Create Native Creative - Issue Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
image-package Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 1/100
Tất cả issue của googleads/googleads-python-lib
Issue tương tự
-
bug priority:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
CyberAgent/psd2svg#436 ·
-
area/install-update comp/cli comp/desktop P3 sweeper:risk-compatibility type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
NousResearch/hermes-agent#122386 · 1 bình luận ·
-
ai-generated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vllm-project/production-stack#1105 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100