fix: well_known_url field deprecation warning - #1625
Conversation
There was a problem hiding this comment.
I think you're right - if pydantic intercepts the field access to raise a deprecation warning that is probably enough and we can remove this entire check
There was a problem hiding this comment.
From looking at the stdio output in the tests, I now think when using the cli you don't see the pydantic warning, so may still be good to have the check
| raise ValueError("Please provide 'OIDCConfig.issuer'") | ||
| if self.well_known_url: | ||
| if "well_known_url" in self.model_fields_set: | ||
| LOGGER.warning( |
There was a problem hiding this comment.
I think this should either raise a warning or log a message. Logging a warning is not really doing either how they're intended.
There was a problem hiding this comment.
Makes sense, I've made it a log message
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1625 +/- ##
=======================================
Coverage 95.96% 95.96%
=======================================
Files 45 45
Lines 3317 3317
=======================================
Hits 3183 3183
Misses 134 134 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
I've been using the
OIDCConfigclass in the queue service, and ran into a bug where my tests were failing because of a deprecation warning.The issue is that even if you don't use the deprecated field (
well_known_url), the model itself accesses it when it doesif self.well_known_url:. This causes pydantic to emit a warning which causes tests to fail. I've replaced this with a check that doesn't access the actual field which fixes the issue.Since pydantic also emits its own warning, we could probably get rid of the check all together.