Skip to content

Preserve explicit compatibility mode in 1.0 #285

Description

@Mattsface

Preserve explicit compatibility mode in 1.0

Parent release issue: #282

Depends on: #283

Why

Version 1.0.0 changes the default, but users still need a deliberate migration escape hatch. Explicit strict_http=False should preserve the 0.9.x compatibility path without weakening the new default.

Scope

For:

mlbstatsapi.Mlb(strict_http=False)

preserve the following behavior:

  • Final non-404 4xx responses return the historical empty result
  • MlbHttpCompatibilityWarning is emitted
  • Warning text explains that strict behavior is now the default
  • Endpoint-specific 404 behavior remains unchanged
  • Final 5xx responses still raise MlbHttpError
  • Retry exhaustion occurs before compatibility handling

Warning behavior

The warning must:

  • Use the public MlbHttpCompatibilityWarning category
  • Inherit from FutureWarning
  • Include the status code and request URL
  • Avoid response-body content or credentials
  • Point to the user's public call site rather than an internal adapter frame
  • Be emitted only for explicit compatibility-mode suppression of final non-404 4xx responses

Acceptance criteria

  • Explicit strict_http=False retains the historical empty-result behavior
  • The warning is emitted exactly once per suppressed final response
  • Warning filename and line number identify the public caller
  • No warning is emitted for successful responses, 404s, intermediate retries, final 5xx responses, or strict mode
  • Caller-injected Session configuration remains untouched
  • Compatibility mode works through both Mlb and direct MlbDataAdapter construction
  • Tests clearly distinguish the compatibility opt-out from the 1.0 default

Suggested branch

feat/v1-compatibility-mode

Start from and target:

release/1.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions