-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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
| current_path = Path(__file__).parent | |
| ## Mock client | |
| client = MockAlgorithmClient( | |
| datasets=[ | |
| # Data for first organization | |
| [{ | |
| "database": current_path / "test_data.csv", | |
| "db_type": "csv", | |
| "input_data": {} | |
| }], |
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:
"database": str(current_path / "db-10k.db.sqlite"),