Skip to content

Fix pytest warnings#526

Draft
georgelgeback wants to merge 1 commit intomainfrom
fix-pytest-warnings
Draft

Fix pytest warnings#526
georgelgeback wants to merge 1 commit intomainfrom
fix-pytest-warnings

Conversation

@georgelgeback
Copy link
Copy Markdown
Contributor

I got tired of seeing so many warnings, so I fixed them.

What I manually fixed:

  • Warning: Support for class-based config is deprecated, use ConfigDict instead.

    • This was already set in base_schema.py so we didn't need it. Remove this from some files:
class Config:
    from_attributes = True
  • SADeprecationWarning: Callable object passed to the default parameter for attribute 'standard_food_preferences' in a ORM-mapped Dataclasses context is ambiguous. [...] If this callable is intended to produce Core level INSERT default values for an underlying Column, use the mapped_column.insert_default parameter instead. To establish this callable as providing a default value for instances of the dataclass itself, use the default_factory dataclasses parameter.

    • We want a default value for the instances here.
  • SADeprecationWarning: Callable object passed to the default parameter for attribute 'latest_modified' in a ORM-mapped Dataclasses context is ambiguous, and this use will raise an error in a future release. If this callable is intended to produce Core level INSERT default values for an underlying Column, use the mapped_column.insert_default parameter instead. To establish this callable as providing a default value for instances of the dataclass itself, use the default_factory dataclasses parameter.

    • For latest_modified it needs to be set in the database, we want to "produce Core level INSERT default values" (otherwise it runs when we create the python object). We use insert_default. (We alreay have this with the created at column.)
  • passlib used crypt which was about to be deprecated in a future python version. It's also been about 6 years since last update. We also don't use it??? It's not required-by any package according to pip and not imported.

    • So I removed it.
  • Fakeredis had some warnings which an update fixed.

@georgelgeback georgelgeback marked this pull request as draft April 12, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant