Skip to content

refactor!: Remove unused Configuration fields#1044

Draft
Pijukatel wants to merge 1 commit into
masterfrom
claude/remove-dead-config-fields-jbqdqg
Draft

refactor!: Remove unused Configuration fields#1044
Pijukatel wants to merge 1 commit into
masterfrom
claude/remove-dead-config-fields-jbqdqg

Conversation

@Pijukatel

Copy link
Copy Markdown
Contributor

Description

Removes the dead disable_outdated_warning, fact, and max_paid_dataset_items fields from Configuration as 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 the disable_outdated_warning, fact, and max_paid_dataset_items keys, and passing these as kwargs to Configuration(...) now raises a validation error (extra='forbid').
  • src/apify/_consts.py — intentionally untouched: the ActorEnvVars.MAX_PAID_DATASET_ITEMS, ApifyEnvVars.DISABLE_OUTDATED_WARNING, and ApifyEnvVars.FACT enum entries stay, since the platform still sets those environment variables. This follows the precedent of SDK_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 the ACTOR_MAX_PAID_DATASET_ITEMS environment 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 the max_paid_dataset_items parsing tests and dropped the three env vars from the randomized Actor.get_env() test.

Testing

  • uv run poe check-code passes: lint, type check, and all 478 unit tests (with APIFY_TOKEN unset — one pre-existing test asserts the default token is None and fails in any environment that has the variable set).
  • Verified Configuration() instantiates cleanly and a full Actor.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.
  • Verified Configuration.from_configuration() round-trips from a Crawlee Configuration and model_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

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

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.74%. Comparing base (ed1d8eb) to head (88d6242).

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              
Flag Coverage Δ
e2e ?
integration 57.34% <ø> (-0.04%) ⬇️
unit 83.06% <ø> (-0.02%) ⬇️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants