Title: Create a safer abstraction for `TypeAdapter` validation · Issue #1440 · usethis-python/usethis-python · GitHub
Open Graph Title: Create a safer abstraction for `TypeAdapter` validation · Issue #1440 · usethis-python/usethis-python
X Title: Create a safer abstraction for `TypeAdapter` validation · Issue #1440 · usethis-python/usethis-python
Description: In #1439 it became clear that there are a lot of cases where there is a TypeAdaptor validation in the codebase. To ensure the resulting ValidationErrors are properly caught and re-raised with a dedicated error message, we should: create ...
Open Graph Description: In #1439 it became clear that there are a lot of cases where there is a TypeAdaptor validation in the codebase. To ensure the resulting ValidationErrors are properly caught and re-raised with a ded...
X Description: In #1439 it became clear that there are a lot of cases where there is a TypeAdaptor validation in the codebase. To ensure the resulting ValidationErrors are properly caught and re-raised with a ded...
Opengraph URL: https://github.com/usethis-python/usethis-python/issues/1440
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Create a safer abstraction for `TypeAdapter` validation","articleBody":"In #1439 it became clear that there are a lot of cases where there is a `TypeAdaptor` validation in the codebase.\n\nTo ensure the resulting `ValidationErrors` are properly caught and re-raised with a dedicated error message, we should:\n\n- create 2 wrappers which accept a TypeAdaptor object as the first object, the object to validate as the second argument....\n- the first one would also a custom error class and custom error message as additional arguments. The wrapper will ensure all ValidationErrors are re-raised properly with custom errors\n- the second one would have a third argument giving the default return value for what to do on a validation error.\n- ban the `TypeAdaptor.validate_python` API via ruff config; inline ignore the violation for the two wrappers' use of it.\n- Work through the ruff violations and replace them with the safe wrapper.\n\nWe should document the rationale - we want to ensure that all `ValidationErrors` are handled and do not propogate.","author":{"url":"https://github.com/nathanjmcdougall","@type":"Person","name":"nathanjmcdougall"},"datePublished":"2026-03-20T22:22:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1440/usethis-python/issues/1440"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:521f956c-a663-9a77-1087-31b759ce5f1c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D566:20AD09:1EA2C7C:2B3A4BC:6A4CD06B |
| html-safe-nonce | 618f4f69041e2979a47ea0a6185a78fe5ad3ea6fabe04dfaa0a90e0378e033c0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTY2OjIwQUQwOToxRUEyQzdDOjJCM0E0QkM6NkE0Q0QwNkIiLCJ2aXNpdG9yX2lkIjoiODgwMjUzMjY5NjA5MTU3ODQ3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 211fbfa64ca9d35830dd1d6a968ec1a005168d9d3a67e4bc03e2de6485ec58ab |
| hovercard-subject-tag | issue:4110379179 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/usethis-python/usethis-python/1440/issue_layout |
| twitter:image | https://opengraph.githubassets.com/46e5908f3ac6b9fc40c38a17304a805bb6c39561ef042b7c56a39f7a08fcf806/usethis-python/usethis-python/issues/1440 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/46e5908f3ac6b9fc40c38a17304a805bb6c39561ef042b7c56a39f7a08fcf806/usethis-python/usethis-python/issues/1440 |
| og:image:alt | In #1439 it became clear that there are a lot of cases where there is a TypeAdaptor validation in the codebase. To ensure the resulting ValidationErrors are properly caught and re-raised with a ded... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nathanjmcdougall |
| hostname | github.com |
| expected-hostname | github.com |
| None | ee8a9d18044a05fe2d57b9ae797da38c8be34effb03f015f7c42e94770d28a1b |
| turbo-cache-control | no-preview |
| go-import | github.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git |
| octolytics-dimension-user_id | 216362695 |
| octolytics-dimension-user_login | usethis-python |
| octolytics-dimension-repository_id | 842189705 |
| octolytics-dimension-repository_nwo | usethis-python/usethis-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 842189705 |
| octolytics-dimension-repository_network_root_nwo | usethis-python/usethis-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f84814acc6f036583fd43463f5847a846243d2a4 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width