-
Notifications
You must be signed in to change notification settings - Fork 108
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
Replace the warning log with a warnings.warn instead. #138
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #138 +/- ##
=======================================
Coverage 99.97% 99.97%
=======================================
Files 302 302
Lines 60584 60584
=======================================
Hits 60566 60566
Misses 18 18 ☔ View full report in Codecov by Sentry. |
Thanks for your PR, it seems good but can you check Travis build for python 3.10 |
I did have a look, but I'm a little bit at a loss here... I'm tried run mypy locally: I get a ton of errors that I don't see on travis. Yet, the error on travis I don't see locally. The error seems to occur or at least is related to numpy. AFAICS I don't think fhir.resources itself depends on numpy. I think numpy is a (test?) dependency for orjson. Perhaps you can trigger a travis build of the main branch manually (I don't seem to have that permission of travis) to see if the error also occurs there? If you have any other idea, let me know! |
I am not 100% sure but the most provably, because of mypy version in your local, you are seeing too many errors but not in travis. for example if look at inside setup.py //"mypy" + (PY_VERSION_11_OR_LATER and ">=0.991" or "==0.812")// I can also look that linting error, but unfortunately I am too busy right now :) |
I'll try to dig a bit further as well. In the meantime I tried removing the |
As a result the warning is only issued once by default. A developer can choose to configure what warnings are filtered how.
Rationale: When using fhir.resources from an application framework such as fastapi, that expects to be able to use the Pydantic APIs for
dict()
andjson()
etc. the log will be "spammed" with warnings. The developer that uses the framework though has very limited control over this short of re configuring the log levels.