Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow optional cast target when instructions are provided #848

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

jlowin
Copy link
Member

@jlowin jlowin commented Feb 14, 2024

In line with other functions, makes target an optional argument for casting if and only if instructions are supplied. Generally, instructions are inferred from the type (e.g. int or a pydantic model), but if manual instructions are provided without a target type, it is safe to return a str. However, if no instructions are provided, a str → str cast is too general an assumption to make.

@zzstoatzz zzstoatzz merged commit 3bfaa07 into main Mar 7, 2024
14 of 15 checks passed
@zzstoatzz zzstoatzz deleted the cast-default branch March 7, 2024 16:03
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.

2 participants