Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will fix #97 - I encountered the same problems when I needed to upgrade to Pydantic v2 in my DBT project.
Two changes are required to effect the migration:
First, I have removed the import of
PydanticValueError
, which no longer exists. I don't think any special functionality was provided by this import, and my sense is that thePydantic...
errors are for their internal use (the errors codes are now hardwired intoErrorCodes
, aLiteral
, and don't seem to encourage custom use as previously indbt2looker
. Therefore the custom error is now derived fromValueError
and should produce the same output message if a specific adaptor is not supported.Secondly,
Optional
fields are now handled differently. I have given a default value ofNone
to all the ones that had no default value, which should be behaviour-preserving (value doesn't have to be supplied and doesn't have a 'special' default value).I tested it on my own DBT project to verify that nothing unexpected happens.
IMPORTANT NOTE
Naturally I need to keep my own fork of the project operational. Therefore this PR is built on top of my stack of open PRs. It is the fourth in the stack. Reviewers should review only the most recent commit.