Skip to content

Commit 532ee8f

Browse files
fix(types): preserve back-compat aliases for renamed inline classes
Registering schemas as named top-level models in openapi.stainless.yaml moved several previously-inline class definitions to their own files: TaskAdvancedSettings(Param), FullContentSettingsParam, FindAllCandidate, FindAllCandidateMetrics, FindAllRunStatus, MatchCondition(Param), TaskRunSourceStats, TaskRunProgress*Event. The old inline names disappeared from their original modules, which Stainless's breaking-change detector flagged as removals. Add deprecated aliases at the original import paths so user code that referenced these names continues to work: - types/run_input.py::AdvancedSettings - types/run_input_param.py::AdvancedSettings - types/task_run_create_params.py::AdvancedSettings - types/advanced_extract_settings_param.py::FullContentFullContentSettings - types/task_run_events_response.py::TaskRunProgressStatsEventSourceStats - types/beta/task_run_create_params.py::AdvancedSettings - types/beta/findall_candidate_match_status_event.py::Data - types/beta/findall_create_params.py::MatchCondition - types/beta/findall_run.py::{Status, StatusMetrics} - types/beta/findall_run_result.py::Candidate - types/beta/beta_extract_params.py::FullContentFullContentSettings - types/beta/task_run_events_response.py::TaskRunProgressStatsEventSourceStats - types/beta/task_group.py (new — re-export GA TaskGroup) The TS SDK already handles this implicitly via namespace declaration merging; Python has no equivalent so we add the aliases manually.
1 parent e4008e4 commit 532ee8f

13 files changed

Lines changed: 74 additions & 0 deletions

src/parallel/types/advanced_extract_settings_param.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ class AdvancedExtractSettingsParam(TypedDict, total=False):
3333
Set to true to enable with defaults, false to disable, or provide
3434
FullContentSettings for fine-grained control.
3535
"""
36+
37+
38+
# Backwards-compat alias (deprecated). `FullContentFullContentSettings` was the
39+
# auto-generated nested-class name in this module; it now lives as the top-level
40+
# `FullContentSettingsParam`.
41+
FullContentFullContentSettings = FullContentSettingsParam

src/parallel/types/beta/beta_extract_params.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,8 @@ class BetaExtractParams(TypedDict, total=False):
6161
Excerpts: TypeAlias = Union[bool, ExcerptSettingsParam]
6262

6363
FullContent: TypeAlias = Union[bool, FullContentSettingsParam]
64+
65+
# Backwards-compat alias (deprecated). `FullContentFullContentSettings` was an
66+
# inline TypedDict in this module; it now lives as the top-level
67+
# `FullContentSettingsParam`.
68+
FullContentFullContentSettings = FullContentSettingsParam

src/parallel/types/beta/findall_candidate_match_status_event.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ class FindAllCandidateMatchStatusEvent(BaseModel):
3737

3838
FindallCandidateMatchStatusEvent = FindAllCandidateMatchStatusEvent # for backwards compatibility with v0.3.4
3939
"""This is deprecated, `FindAllCandidateMatchStatusEvent` should be used instead"""
40+
41+
# Backwards-compat alias (deprecated). `Data` was an inline class in earlier
42+
# releases; it is now the top-level `FindAllCandidate` model.
43+
Data = FindAllCandidate

src/parallel/types/beta/findall_create_params.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,7 @@ class ExcludeList(TypedDict, total=False):
5757

5858
FindallCreateParams = FindAllCreateParams # for backwards compatibility with v0.3.4
5959
"""This is deprecated, `FindAllCreateParams` should be used instead"""
60+
61+
# Backwards-compat alias (deprecated). `MatchCondition` was an inline TypedDict
62+
# in this module; it now lives as the top-level `MatchConditionParam`.
63+
MatchCondition = MatchConditionParam

src/parallel/types/beta/findall_run.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,10 @@ class FindAllRun(BaseModel):
3636

3737
FindallRun = FindAllRun # for backwards compatibility with v0.3.4
3838
"""This is deprecated, `FindAllRun` should be used instead"""
39+
40+
# Backwards-compat aliases (deprecated). `Status` and `StatusMetrics` were
41+
# inline classes in this module; they now live as top-level `FindAllRunStatus`
42+
# and `FindAllCandidateMetrics` models.
43+
from .findall_candidate_metrics import FindAllCandidateMetrics as StatusMetrics # noqa: E402,F401
44+
45+
Status = FindAllRunStatus

src/parallel/types/beta/findall_run_result.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ class FindAllRunResult(BaseModel):
3232

3333
FindallRunResult = FindAllRunResult # for backwards compatibility with v0.3.4
3434
"""This is deprecated, `FindAllRunResult` should be used instead"""
35+
36+
# Backwards-compat alias (deprecated). `Candidate` was an inline class in this
37+
# module; it now lives as the top-level `FindAllCandidate` model.
38+
Candidate = FindAllCandidate
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Backwards-compatible re-export module (deprecated).
2+
#
3+
# Historically this module exposed `TaskGroup` as the data shape for a beta
4+
# task group. The Stainless config no longer aliases the GA `TaskGroup` model
5+
# under `beta` (to avoid a TypeScript class+type collision). Importers that
6+
# still reference `parallel.types.beta.task_group.TaskGroup` should switch to
7+
# `parallel.types.task_group.TaskGroup` instead. This module preserves the old
8+
# import path as a deprecated shim.
9+
10+
from .. import task_group
11+
12+
__all__ = ["TaskGroup"]
13+
14+
TaskGroup = task_group.TaskGroup

src/parallel/types/beta/task_run_create_params.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,8 @@ class TaskRunCreateParams(TypedDict, total=False):
6969

7070
betas: Annotated[List[ParallelBetaParam], PropertyInfo(alias="parallel-beta")]
7171
"""Optional header to specify the beta version(s) to enable."""
72+
73+
74+
# Backwards-compat alias (deprecated). `AdvancedSettings` was an inline TypedDict
75+
# in this module; it now lives as the top-level `TaskAdvancedSettingsParam`.
76+
AdvancedSettings = TaskAdvancedSettingsParam

src/parallel/types/beta/task_run_events_response.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@
1515
Union[TaskRunProgressStatsEvent, TaskRunProgressMessageEvent, TaskRunEvent, ErrorEvent],
1616
PropertyInfo(discriminator="type"),
1717
]
18+
19+
# Backwards-compat alias (deprecated). `TaskRunProgressStatsEventSourceStats`
20+
# was the auto-generated nested-class name for the source-stats payload; it now
21+
# lives as the top-level `TaskRunSourceStats` model.
22+
from ..task_run_source_stats import TaskRunSourceStats as TaskRunProgressStatsEventSourceStats # noqa: E402,F401

src/parallel/types/run_input.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,8 @@ class RunInput(BaseModel):
6464

6565
webhook: Optional[Webhook] = None
6666
"""Webhooks for Task Runs."""
67+
68+
69+
# Backwards-compat alias (deprecated). `AdvancedSettings` was an inline class in
70+
# this module; it now lives as the top-level `TaskAdvancedSettings` model.
71+
AdvancedSettings = TaskAdvancedSettings

0 commit comments

Comments
 (0)