sdk_python icon indicating copy to clipboard operation
sdk_python copied to clipboard

Lots of warnings when using the library

Open fleaz opened this issue 3 years ago • 1 comments

Steps to reproduce:

  1. Install the latest bunq_sdlk version
  2. Load/Create an API context
  3. Call any endpoint

What should happen:

  1. No errors or warnings when using the latest stable release

What happens:

I get half a screen full of warnings because the json converter encountered keys that it is not aware of. Example:

/usr/local/lib/python3.8/site-packages/bunq/sdk/json/converter.py:294: UserWarning: [bunq SDK beta] Key "style" in "Avatar" is unknown.
  warnings.warn(cls._WARNING_KEY_UNKNOWN.format(key, context_name))
/usr/local/lib/python3.8/site-packages/bunq/sdk/json/converter.py:294: UserWarning: [bunq SDK beta] Key "country" in "MonetaryAccountBank" is unknown.
  warnings.warn(cls._WARNING_KEY_UNKNOWN.format(key, context_name))
/usr/local/lib/python3.8/site-packages/bunq/sdk/json/converter.py:294: UserWarning: [bunq SDK beta] Key "timezone" in "MonetaryAccountBank" is unknown.
  warnings.warn(cls._WARNING_KEY_UNKNOWN.format(key, context_name))
/usr/local/lib/python3.8/site-packages/bunq/sdk/json/converter.py:294: UserWarning: [bunq SDK beta] Key "profile_action_required" in "MonetaryAccountProfile" is unknown.

SDK version and environment

  • Tested on 1.14.18
  • [x] Sandbox
  • [ ] Production

fleaz avatar Mar 31 '21 15:03 fleaz

You can turn off these warnings by importing the warning module: https://docs.python.org/3/library/warnings.html

import warnings

warnings.simplefilter("ignore")

^ that should do the trick

Hattorius avatar Feb 26 '24 21:02 Hattorius