Skip to content
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

[Bugfix/TradeBalance] Fix parameter name for TradeBalance and handle 'null' response from EconDB API #2179

Merged
merged 3 commits into from
Jul 26, 2022

Conversation

asymness
Copy link
Contributor

Description

  • Summary of the change / bug fix:
    • The parameter being used in economy/macro for Trade Balance was incorrect (TBFR) which is specific to France. The general parameter name should be TB. I.e. TB<country_code>
    • In some cases, econdb API returns null response with 200 status code which raises an error "NoneType object is not subscriptable", the second commit fixes this issue by checking the response content before trying to parse it into a Series.
  • Link # issue: [Bug]economy/macro - TBFR: Error: 'NoneType' object is not subscriptable #2152
  • Screenshot of the feature or the bug before/after fix, if applicable.
    Before

image

After
image

  • Relevant motivation and context: The Trade Balance indicator was not functional prior to this change in economy/macro.
  • List any dependencies that are required for this change: None

How has this been tested?

  • Please describe the tests that you ran to verify your changes.
    Ran macro command for various countries using TB parameter.

  • Provide instructions so we can reproduce.
    Run Trade Balance indicator using TBFR parameter with any country to reproduce in economy/macro.

  • Please also list any relevant details for your test configuration.
    N/A

Checklist:

Others

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My code passes all the checks pylint, flake8, black, ... To speed up development you should run pre-commit install.
  • New and existing unit tests pass locally with my changes. You can test this locally using pytest tests/....

@jmaslek jmaslek added the bug Fix bug label Jul 26, 2022
@jmaslek jmaslek requested a review from JerBouma July 26, 2022 02:03
Copy link
Contributor

@JerBouma JerBouma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fix bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants