-
-
Notifications
You must be signed in to change notification settings - Fork 101
chore: warn on deprecated parameter usage #689
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
Conversation
eb46288
to
01dc421
Compare
Documentation preview will be available shortly at https://litestar-org.github.io/polyfactory-docs-preview/689 |
@@ -114,6 +114,9 @@ Any other field definition will not be checked. | |||
:caption: Enable Check Factory Fields | |||
:language: python | |||
|
|||
.. note:: | |||
The default for `__check_model__` is changed to `True` in v3. Set explicitly to disable this check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean set __check_model__
explicitly? I tried both __check_model__ = False
and True
and still getting the warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for flagging. This logic is wrong. I'll raise a PR for this shortly
@@ -28,6 +28,9 @@ By default, ``__set_relationships__`` is set to ``False``. If it is ``True``, al | |||
.. note:: | |||
If ``__set_relationships__ = True``, ForeignKey fields associated with relationship() will be automatically generated by ``build`` method because :class:`__set_foreign_keys__ <polyfactory.factories.sqlalchemy_factory.SQLAlchemyFactory.__set_foreign_keys__>` is set to ``True`` by default. But their values will be overwritten by using ``create_sync``/ ``create_async`` methods, so SQLAlchemy ORM creates them. | |||
|
|||
.. note:: | |||
The default for `__set_relationships__` is changed to `True` in v3. Set explicitly to retain existing behaviour. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the best approach here? I have removed the __set_relationships__ = True
flag, but the warning still occurs. Additionally, we get a similar warning for __set_association_proxy__
, even though it is not set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @arjentraas , this is a bug found and should be silenced in this case. It will be fixed in next release. See #723
Description
Closes
__check_model__
and other constants #681 (comment)