Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-4198

Models are out of date with the new pydantic modeling paradigm from pydantic 2.0

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • farmgen-2024.next
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Context

      Seems like this is still using the old implementation of Config for pydantic. For example:
      class RefreshToken(RefreshTokenUpdate): class Config: from_attributes = True
       
      Should now be re-written as:
      {{}}

      from pydantic import ConfigDict 
      class RefreshToken(RefreshTokenUpdate): 
          model_config = ConfigDict(from_attributes=True)   

       
      I believe you should be able to use Bump Pydantic to get a lot of these things fixed with minimal work

      Definition of done

      What must be done to consider the task complete?

      Pitfalls

      What should the implementer watch out for? What are the risks?

            Assignee:
            jib.adegunloye@mongodb.com Jib Adegunloye
            Reporter:
            jib.adegunloye@mongodb.com Jib Adegunloye
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: