Add test to avoid unwanted dependencies among backends
See original GitHub issueIbis had some interdependencies among backends that have been causing some issues, besides making the codebase unnecessarily complicated.
We are finishing a major refactoring to make the dependencies more reasonable. Mainly, to avoid unrelated backends to depend among them (bigquery or spark depending on impala), and creating some base backends with the code shared among them.
I think it would be great if we can have a test that makes sure there are not unwanted dependencies among backends.
I think we can probably have a list of the backends with the known dependencies, load each backend, and check if any unknown backend has been loaded. As a general idea (code not expected to work):
BACKEND_DEPS = {'sqlite': ['base_sqlalchemy'],
'bigquery': ['base_sql'],
...}
for backend, known_deps in BACKEND_DEPS:
importlib.load(f'ibis.backends.{backend}')
assert not any(mod in sys.modules if mod.startswith('ibis.backends') and mod not in known_deps)
importlib.unload(...)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Handle the dependencies of a Maven Project after the build
First this approach is called a multi module build which is a perfect fit for such things. Wouldn't that mean that when in...
Read more >Removing Dependencies: One Weird Trick for Increasing ...
Code in an unmaintained dependency may either stop compiling or, more often, cause compilation warnings because of deprecations.
Read more >Manage Bundler indirect dependencies versions - JTWay
What to do if there is a new breaking version of the indirect dependency, causing deployment ... Avoid data migrations in the schema...
Read more >Testing External Dependencies with Fakes - Big Nerd Ranch
Check out our blog post Testing External Dependencies with Fakes from Big Nerd Ranch. Learn more and read it now!
Read more >Pitfalls and Patterns in Microservice Dependency Management
Having isolated serving stacks may prevent a global outage of your service. This includes the dependencies of your service run by 3rd parties...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If
del sys.modules...
works I’d go for that. Adding tests for each backends is very repetitive, and we’ll end up missing backends in the future.Thanks @matthewmturner that sounds like good ideas. But I don’t think we can do number 2. If you move the
conftest.py
file, I think it won’t be applied to the backend tests then, which is it’s goal.This is a nice to have, but surely not a blocker, and lower priority than the refactoring itself, but if you feel like working on it, it’ll be useful to know when we’re done with the refactoring. 😃