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
The code generated by the template creates a MockAlgorithClient instance passing a 'database' key value of type PosixPath (the type returned by Path(__file__).parent:
However, the MockAlgorithmClient constructor uses this key value as the database_uri argument of wrapper's load_data, which, by definition, should be a string:
This inconsistency makes the mock-client code generated by v6 algorithm create crash when using a SQL data source, as the load_data implementation for SQL uses string functions (endswith, split, etc).
As a workaround for the algorithm I'm working on, I simply use str() on these keys:
The code generated by the template creates a MockAlgorithClient instance passing a 'database' key value of type PosixPath (the type returned by
Path(__file__).parent
:v6-algorithm-template/test/test.py.jinja
Lines 18 to 28 in f9073e8
However, the MockAlgorithmClient constructor uses this key value as the
database_uri
argument of wrapper'sload_data
, which, by definition, should be a string:https://github.com/vantage6/vantage6/blob/2a16890bde9abaf61cf134b00d8553ff5b5ce276/vantage6-algorithm-tools/vantage6/algorithm/tools/wrappers.py#L58-L60
This inconsistency makes the mock-client code generated by
v6 algorithm create
crash when using a SQL data source, as theload_data
implementation for SQL uses string functions (endswith, split, etc).As a workaround for the algorithm I'm working on, I simply use
str()
on these keys:"database": str(current_path / "db-10k.db.sqlite"),
The text was updated successfully, but these errors were encountered: