Skip to content

refactor: replace type aliases with NewType#180

Merged
tmi merged 1 commit intodevelopfrom
refac/namedTypes
Mar 31, 2026
Merged

refactor: replace type aliases with NewType#180
tmi merged 1 commit intodevelopfrom
refac/namedTypes

Conversation

@tmi
Copy link
Copy Markdown
Collaborator

@tmi tmi commented Mar 27, 2026

for TaskId, HostId, StorageId, JobId, ComponentId

Converts all SomeType = str/int type aliases in src/cascade to typing.NewType, preventing arbitrary string/int usage where a specific type is expected. Adds casts and wrapping calls at all creation sites in source files, tests, and integration_tests.

cc @jinmannwong @HCookie -- this may force to you to cast at times when interacting with low level cascade (eg when picking a DatasetId), but ultimately this should make much safer code

a pity I've learned about it only today, it should have been in the codebase from day 0 :) . If for some reason it would prove too strict or annoying, we can always revert (agentically) -- I consider it an experiment at this moment

…geId, JobId, ComponentId

Converts all SomeType = str/int type aliases in src/cascade to
typing.NewType, preventing arbitrary string/int usage where a
specific type is expected. Adds casts and wrapping calls at all
creation sites in source files, tests, and integration_tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tmi tmi merged commit e62626a into develop Mar 31, 2026
10 checks passed
@tmi tmi deleted the refac/namedTypes branch March 31, 2026 08:25
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.

1 participant