question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add test to avoid unwanted dependencies among backends

See original GitHub issue

Ibis 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:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
datapythonistacommented, Nov 9, 2020

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.

1reaction
datapythonistacommented, Oct 26, 2020

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. 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found