0

我正在使用 Consumption Price Sheet SDK Python 并且出现错误。它已经运行了很长时间。在 2020/08 月份,它失败了:

'NoneType' object has no attribute 'additional_properties'

虽然 API 没有字段 Additional_properties 的描述,但它来了。现在给出这个错误。

字段“meterdertails.additional_properties”也是如此。

代码:

consumption_client.price_sheet.api_version = '2019-10-01'
priceSheetResult = consumption_client.price_sheet.get_by_billing_period(billing_period_name=self.partition_date.replace('-', '')[0:6], expand='properties/meterDetails')

return priceSheetResult

错误之前正确的示例:

{"unit_of_measure": "1 Hour", "billing_period_id": "/subscriptions/.../providers/Microsoft.Billing/billingPeriods/20190601", "offer_id": "MS-AZR-0017P", "unit_price": "2", "included_quantity": "0", "part_number": "AAA", "additional_properties": null, "meter_id": "111111111111111", "currency_code": "EUR", "meter_details": {"meter_name": "NC24", "service_tier": null, "meter_category": "Virtual Machines", "service_name": null, "additional_properties": null, "meter_sub_category": "NC Promo Series Windows", "pretax_standard_rate": null, "total_included_quantity": null, "meter_location": "EU West", "unit": "1 Hour"}}
4

0 回答 0