Skip to content

Issue with Pydantic Imports #16

@rishabhpoikayil

Description

@rishabhpoikayil

I was following the instructions on the README.md page to construct the graph with just the Mimic-IV dataset. At present, I'm only using the data from the hosp directory.

Constructing the graph using the dataset leads to one specific issue with the Pydantic library. Apparently, the source code uses Pydantic v1 for the graph construction, which is older than the present version. This mismatch seems to result in the following error:

TypeError: BaseModel.validate() takes 2 positional arguments but 3 were given

The expected fix is to install a lower version instead, which I did. Then, I ran into the following error.

RuntimeError: no validator found for <class 'unstructured.documents.elements.Element'>, see arbitrary_types_allowed in Config

image

The actual error is from Line 69 in the above file, which doesn't make sense to me as this line of code should take care of the error. Searching the error online indicates the same thing. I'm not sure if the change in Pydantic versions may be causing this to happen, where certain libraries need the later version of Pydantic but the actual implementation uses the earlier version:

image

Which version of Pydantic would you suggest using in order to resolve this issue and construct the graph successfully? Or is there another fix that I may be missing? Thank you in advance for your assistance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions