You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the code in Query.__init__() raises an error if no valid connection to flowdb exists.
This has various disadvantages. For example, it makes it necessary to create connections in all tests that use a flowmachine query, even if they don't require running it. A more subtle downside is that it encourages to write tests in a more integrationy style (typically running against the database and checking the result, which slows down the test suite) rather than encouraging a design which allows for more unit-style tests.
It would be beneficial if Query objects could be instantiated without requiring an active connection to flowdb (e.g. by passing a dummy connection).
The text was updated successfully, but these errors were encountered:
Definitely. Historical reason for this is that in some cases, the query needs to check against FlowDB to know if there's any chance it can be successfully run (e.g. are there missing dates), or in a few cases, to require another query to be written as a table (e.g. Random). Obviously one can either pass in the connection to init for those cases, or add a secondary pre-flight checks method that does this.
Currently the code in
Query.__init__()
raises an error if no valid connection to flowdb exists.This has various disadvantages. For example, it makes it necessary to create connections in all tests that use a flowmachine query, even if they don't require running it. A more subtle downside is that it encourages to write tests in a more integrationy style (typically running against the database and checking the result, which slows down the test suite) rather than encouraging a design which allows for more unit-style tests.
It would be beneficial if Query objects could be instantiated without requiring an active connection to flowdb (e.g. by passing a dummy connection).
The text was updated successfully, but these errors were encountered: