refactor!: Remove unused Configuration fields#1044
Draft
Pijukatel wants to merge 1 commit into
Draft
Conversation
Remove the dead `disable_outdated_warning`, `fact`, and `max_paid_dataset_items` fields from `Configuration` for the upcoming major release. The SDK never read any of them, and `Actor.get_env()` no longer includes their keys. The corresponding `ActorEnvVars` / `ApifyEnvVars` enum entries for the platform environment variables remain available. The pay-per-event transition docs example now reads the `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable directly, and the removal is documented in the v4 upgrading guide. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FSLrkjZjrkren6sxUw2TYR
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1044 +/- ##
==========================================
- Coverage 91.75% 91.74% -0.01%
==========================================
Files 50 50
Lines 3215 3212 -3
==========================================
- Hits 2950 2947 -3
Misses 265 265
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removes the dead
disable_outdated_warning,fact, andmax_paid_dataset_itemsfields fromConfigurationas part of the upcoming major release cleanup (item D5 — dead config fields). The SDK defined these fields but never read them anywhere.src/apify/_configuration.py— the three field definitions are removed. As a consequence,Actor.get_env()no longer includes thedisable_outdated_warning,fact, andmax_paid_dataset_itemskeys, and passing these as kwargs toConfiguration(...)now raises a validation error (extra='forbid').src/apify/_consts.py— intentionally untouched: theActorEnvVars.MAX_PAID_DATASET_ITEMS,ApifyEnvVars.DISABLE_OUTDATED_WARNING, andApifyEnvVars.FACTenum entries stay, since the platform still sets those environment variables. This follows the precedent ofSDK_LATEST_VERSION/LOG_FORMAT, whose enum entries were kept when their config fields were removed.docs/02_concepts/code/11_conditional_actor_charge.py— the pay-per-result transition example now reads theACTOR_MAX_PAID_DATASET_ITEMSenvironment variable directly (behavior-identical to the previous code for unset/empty values).docs/04_upgrading/upgrading_to_v4.md— new "Unused Configuration fields" section documenting the removal with a behavior-preserving migration snippet.tests/— removed themax_paid_dataset_itemsparsing tests and dropped the three env vars from the randomizedActor.get_env()test.Testing
uv run poe check-codepasses: lint, type check, and all 478 unit tests (withAPIFY_TOKENunset — one pre-existing test asserts the default token isNoneand fails in any environment that has the variable set).Configuration()instantiates cleanly and a fullActor.init()/push_data()/exit()lifecycle succeeds with all three environment variables set — pydantic-settings ignores env vars without a matching field, so platform-set values are harmless.Configuration.from_configuration()round-trips from a CrawleeConfigurationandmodel_dump(by_alias=True)output no longer contains the removed keys.🤖 Generated with Claude Code
https://claude.ai/code/session_01FSLrkjZjrkren6sxUw2TYR
Generated by Claude Code