Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pythonic resources] only import pydantic core if using pydantic 2 (#…
…17589) ## Summary Pydantic 2 introduces a `pydantic_core` module which holds some core imports separate from the main module. Theoretically, a user should only have it installed if using `pydantic>=2.0.0`, but it may happen that version requirement pins lead a user to first install `pydantic>=2.0.0` (and `pydantic_core`) and then later downgrade to `pydantic<2.0.0`. Dagster will misbehave in this case, since we would use the `pydantic>=2.0.0` notion of 'undefined' from `pydantic_core` in this case instead of `None`. This change makes us more strictly use this import if and only if pydantic 2 is being used. ## Test Plan Manually constructed environment locally w/ `pydantic<2.0.0` and `pydantic-core`, ran tests which failed. Ran tests with change in this PR, tests succeed.
- Loading branch information