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
Update API endpoint from deprecated api.coindix to new api.nanoly #5849
base: develop
Are you sure you want to change the base?
Update API endpoint from deprecated api.coindix to new api.nanoly #5849
Conversation
Hi there! Thanks for the PR. This looks pretty good, but the code linters are picking up something.
You can install the pre-commit hooks by running:
This will run the series of linters, as well as the testing suite, locally before the commit goes to GitHub. As the name of the data source is changing, we need to reflect that change on-screen. This is accomplished by updating this file: Doing this will also trigger the need to recapture the controller test output because the contents of the menu screen will have changed. |
Hi, thanks for the feedback! I ran openbb_platform/providers/alpha_vantage/tests/test_alpha_vantage_fetchers.py:25:5: PLW0127 Self-assignment of variable `params`
openbb_platform/providers/cboe/tests/test_cboe_fetchers.py:86:5: PLW0127 Self-assignment of variable `params`
openbb_terminal/keys_model.py:947:9: PLW0127 Self-assignment of variable `r`
openbb_terminal/stocks/fundamental_analysis/yahoo_finance_model.py:295:11: S310 Audit URL open for permitted schemes. Allowing use of `file:` or custom schemes is often unexpected.
Found 4 errors. It found a few errors but these are files that I have not made changes to so some I would appreciate some guidance on what to do here. I also installed |
…OpenBBTerminal into hotfix/update-api-endpoint
@@ -9,8 +9,8 @@ | |||
|
|||
from openbb_terminal.core.session.current_user import get_current_user | |||
from openbb_terminal.cryptocurrency.defi import ( | |||
coindix_model, | |||
coindix_view, | |||
nanoly_model, |
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.
It is right here where Ruff is tripping. It wants to see these sorted alphabetically.
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.
Nice catch!
I have reordered the imports in defi_controller.py
such that they're in alphabetical order in commit: 8b925e2
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.
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, I have tried running the command you suggested but I can't get it to run on my machine locally.
The command:
pytest tests/openbb_terminal/cryptocurrency/test_defi_controller.py --record-mode once --rewrite-expected
and receive this error:
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --record-mode once
inifile: /Users/davidtran/Code/OpenBBTerminal/pytest.ini
rootdir: /Users/davidtran/Code/OpenBBTerminal
I have also ran
pytest tests/openbb_terminal/cryptocurrency/test_defi_controller.py --record-mode=once --rewrite-expected
But received the same error.
Do you have any suggestions where to go from here?
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.
oooo.. looks like I missed a sub-folder (defi), sorry about that.
tests/openbb_terminal/cryptocurrency/defi/test_defi_controller.py
…n alphabetical order
This PR addresses issue #5631, it fixes the
/crypto/defi/vaults
command.The api endpoint
https://api.coindix.com/
andhttps://apiv2.coindix.com/
has been replaced withhttps://api.nanoly.com/
since coindix was renamed to nanoly last year.Without the fix running
/crypto/defi/vaults
results in:Running
/crypto/defi/vaults
after the fix resolves this issue: