Skip to content

Migrate python collection types from typing types to native types#134

Open
chimosky wants to merge 3 commits intoroostorg:mainfrom
chimosky:migrate-to-native-types
Open

Migrate python collection types from typing types to native types#134
chimosky wants to merge 3 commits intoroostorg:mainfrom
chimosky:migrate-to-native-types

Conversation

@chimosky
Copy link
Copy Markdown
Contributor

@chimosky chimosky commented Feb 5, 2026

Fixes #25

All linting and type checking tests pass.

@chimosky chimosky force-pushed the migrate-to-native-types branch from 4655e1d to 3c8e545 Compare February 6, 2026 16:42
@chimosky
Copy link
Copy Markdown
Contributor Author

@julietshen kindly review.

@julietshen
Copy link
Copy Markdown
Member

If @EXBreder has reviewed then it's good with me! @EXBreder is this good to go?

@chimosky chimosky force-pushed the migrate-to-native-types branch from 3c8e545 to bd615ba Compare February 23, 2026 13:25
@cassidyjames cassidyjames requested review from a team as code owners March 3, 2026 22:11
Signed-off-by: Chihurumnaya Ibiam <ibiamchihurumnaya@gmail.com>
I'm keeping them here so as to avoid a potential bug, it's used in type
checking and it makes sense to keep it, I've added a second type for
Union using UnionType.

Consistency with the placement of None for optional arguments has also
been improved.

Signed-off-by: Chihurumnaya Ibiam <ibiamchihurumnaya@gmail.com>
@chimosky chimosky force-pushed the migrate-to-native-types branch from 8b04621 to eee8332 Compare March 25, 2026 16:32
@chimosky chimosky requested a review from ayubun as a code owner March 25, 2026 16:32
@chimosky
Copy link
Copy Markdown
Contributor Author

@julietshen I've rebased master on this, and it has been approved.

Bringing this to your attention as you probably have a lot on your plate and this got drowned in your inbox.

# Mypy doesn't like runtime types like this
# noinspection PyTypeChecker
return Union[tuple(inner.to_typing_type() for inner in self.inner_types)] # type: ignore
return reduce(operator.or_, (inner.to_typing_type() for inner in self.inner_types)) # type: ignore
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting 😮

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I got help from an LLM for this particular change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we deleting this file ? i understand its commented out, and to be honest i forget why, but we should probably leave that for a diff pr ^^" saved queries are still something osprey supports

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added it back in e643ae1.

I deleted it before for no reason in particular as it
was commented out, I'm adding it back now.

Signed-off-by: Chihurumnaya Ibiam <ibiamchihurumnaya@gmail.com>
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.

migrate python collection types from typing types to native types (i.e. List[str] -> list[str])

4 participants