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

Improve engine selection #3

Open
CaselIT opened this issue Feb 23, 2020 · 0 comments
Open

Improve engine selection #3

CaselIT opened this issue Feb 23, 2020 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@CaselIT
Copy link
Contributor

CaselIT commented Feb 23, 2020

Currently when read_from_rw_engines or write_to_rw_engines are False and no engine is read-only or write-only all the engine are used.

def _filter_by_role(self, engines, role):
filtered = tuple(engine for engine in engines
if self._engines.get(engine) == role)
return filtered or engines

This behavior is quite strange, since the option is not respected.

Raising an error in this case would probably be more appropriate, the problem with the exception is that by adding the engines one by one it's easy to encounter an error while adding them.

I'm not sure how to best support this scenario.
One option is to make the engine selection lazy, so that only on the first use we check for this, the user does not have an immediate feedback with this approach

@vytas7 vytas7 added the enhancement New feature or request label Jun 19, 2020
@vytas7 vytas7 added the documentation Improvements or additions to documentation label Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants