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

DM-37214: Fix problem with JSON formatter when Pydantic is used but Dict requested #761

Merged
merged 6 commits into from
Dec 9, 2022

Commits on Dec 7, 2022

  1. Add failing unit test for DM-37214.

    TallJimbo authored and timj committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    3829f7d View commit details
    Browse the repository at this point in the history
  2. Reorganize handling of components and built-in types

    Now that read storage class being different to write
    storage class no longer directly means that a component
    is being used, the logic in FileFormatter to extract
    a component has to change.
    
    1. The extraction must happen from the original python
       type that was written and not the, possibly, generic
       python type read from disk. This requires we do a
       coercion before extracting the component.
    2. Built-in types must always be converted to the
       original storage class before conversion to the
       requested read storage class.
    3. Remove duplicate logic from JSON and YAML that
       was trying to convert built-in types to the
       requested type. This now has moved to the
       parent class.
    timj committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    955b30d View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2022

  1. Additional docs and cleanups for builtin to type conversion

    Remove the requirement that we only do this if we did not
    write it originally as a built-in type -- it didn't really
    affect the code because of the presence of the isinstance
    check later on (which has now moved into the main check).
    timj committed Dec 8, 2022
    Configuration menu
    Copy the full SHA
    d2a36d9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    554f39a View commit details
    Browse the repository at this point in the history
  3. Add tests for JSON and YAML formatter usage

    Test that we can round trip Pydantic models, dataclasses,
    classes that get created from dicts, and tuples using JSON
    and YAML formatters.
    timj committed Dec 8, 2022
    Configuration menu
    Copy the full SHA
    e2225d9 View commit details
    Browse the repository at this point in the history
  4. Add news fragment

    timj committed Dec 8, 2022
    Configuration menu
    Copy the full SHA
    c2e3f5e View commit details
    Browse the repository at this point in the history