I have a csv file where one of the columns is written in hstore format. I would like to convert it into python dict but at the same time keep my code DRY. My codebase uses sqlalchemy, which has a _parse_hstore
function defined in https://github.com/sqlalchemy/sqlalchemy/blob/master/lib/sqlalchemy/dialects/postgresql/hstore.py#L390. I tried to import it like this:
import sqlalchemy.dialects.postgresql.hstore as hstore
But unfortunately the upstream module (sqlalchemy.dialects.postgresql
) shadows the hstore module with an object: https://github.com/sqlalchemy/sqlalchemy/blob/master/lib/sqlalchemy/dialects/postgresql/init.py#L53
Is it still possible to import the module somehow? I'd prefer not to copy function code directly into my codebase even if the function is relatively simple.