File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3- import json
43import math
54from dataclasses import dataclass
65from datetime import datetime , timezone
@@ -343,7 +342,7 @@ async def _fetch_pricing_info(self) -> _FetchedPricingInfoDict:
343342 if self ._configuration .actor_pricing_info and self ._configuration .charged_event_counts :
344343 return _FetchedPricingInfoDict (
345344 pricing_info = self ._configuration .actor_pricing_info ,
346- charged_event_counts = json . loads ( self ._configuration .charged_event_counts ) ,
345+ charged_event_counts = self ._configuration .charged_event_counts ,
347346 max_total_charge_usd = self ._configuration .max_total_charge_usd or Decimal ('inf' ),
348347 )
349348
Original file line number Diff line number Diff line change @@ -427,15 +427,16 @@ class Configuration(CrawleeConfiguration):
427427 description = 'JSON string with prising info of the actor' ,
428428 discriminator = 'pricing_model' ,
429429 ),
430- BeforeValidator (lambda data : json .loads (data ) if data else None ),
430+ BeforeValidator (lambda data : json .loads (data ) if isinstance ( data , str ) else data if data else None ),
431431 ] = None
432432
433433 charged_event_counts : Annotated [
434- str | None ,
434+ dict [ str , int ] | None ,
435435 Field (
436436 alias = 'apify_charged_actor_event_counts' ,
437437 description = 'Counts of events that were charged for the actor' ,
438438 ),
439+ BeforeValidator (lambda data : json .loads (data ) if isinstance (data , str ) else data if data else None ),
439440 ] = None
440441
441442 @model_validator (mode = 'after' )
You can’t perform that action at this time.
0 commit comments