Skip to content

fix: parse actor_pricing_info into Apify API client pricing models - #1172

Merged
vdusek merged 2 commits into
masterfrom
chore/bump-ty-0.0.86
Oct 12, 2026
Merged

vdusek merged 2 commits into
masterfrom
chore/bump-ty-0.0.86

Conversation

@vdusek

@vdusek vdusek commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Configuration.actor_pricing_info now holds the apify-client pricing models (FreeActorPricingInfo, FlatPricePerMonthActorPricingInfo, PricePerDatasetItemActorPricingInfo, PayPerEventActorPricingInfo). The SDK subclasses of these models, along with ActorChargeEvent and PricingPerEvent, are removed from apify._charging. They made fields optional that the client requires (apifyMarginPercentage, createdAt, startedAt, trialMinutes, pricePerUnitUsd, unitName, eventDescription), and ty 0.0.86 reports those overrides as invalid.

The platform builds APIFY_ACTOR_PRICING_INFO from the run's pricingInfo and removes only eventDescription from each charge event (getPricingInfoJson() in apify-worker). The env var parser fills a missing eventDescription with an empty string, so event_description is '' where it used to be None. The parser copies a dict passed by the caller before filling it in, and leaves malformed nested values for pydantic to reject. The v4 upgrade guide is updated to match.

The PR also bumps ty from 0.0.84 to 0.0.86 and fixes its other errors:

  • @contextmanager / @asynccontextmanager functions return Generator / AsyncGenerator.
  • Configuration.model_config is a SettingsConfigDict, and pydantic-settings is now a direct dependency.

✍️ Drafted by Claude Code

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Oct 12, 2026
@vdusek vdusek self-assigned this Oct 12, 2026
@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.54839% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.05%. Comparing base (a0f54b2) to head (5da59b3).

Files with missing lines Patch % Lines
src/apify/_configuration.py 91.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1172      +/-   ##
==========================================
- Coverage   93.22%   93.05%   -0.18%     
==========================================
  Files          54       54              
  Lines        3721     3671      -50     
==========================================
- Hits         3469     3416      -53     
- Misses        252      255       +3     
Flag Coverage Δ
e2e 31.73% <51.61%> (?)
integration 51.70% <54.83%> (-1.03%) ⬇️
unit 89.78% <93.54%> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek changed the title fix: resolve type errors reported by ty 0.0.86 fix: use apify-client pricing models directly Oct 12, 2026
@vdusek
vdusek force-pushed the chore/bump-ty-0.0.86 branch from 45d9a76 to d40af90 Compare October 12, 2026 07:08
@vdusek
vdusek marked this pull request as ready for review October 12, 2026 07:21
@vdusek
vdusek requested a review from szaganek as a code owner October 12, 2026 07:21
@vdusek
vdusek requested a review from Mantisus October 12, 2026 07:21
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Oct 12, 2026

@Mantisus Mantisus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@apify-approval-mirror apify-approval-mirror Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mirroring approval from @Mantisus.

@vdusek vdusek changed the title fix: use apify-client pricing models directly fix: parse actor_pricing_info into Apify API client pricing models Oct 12, 2026
@vdusek
vdusek merged commit 31c351a into master Oct 12, 2026
35 checks passed
@vdusek
vdusek deleted the chore/bump-ty-0.0.86 branch October 12, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants