(It is always fun to dog-food your own software and realize how bad of a programmer one is)...
Presently, pyiem.database.get_dbconnstr does a lot of "magic" without any consideration of environment variables to control how the database user is guessed, when not provided. Well, when pyiem is called from external software, this isn't a huge deal as developers can pass a user= parameter. The issue is when pyiem itself calls the API internally, this has no knobs to control and only works if one of the hard-wired USERNAME_MAPPER hits. We can do better than this, maybe.
(It is always fun to dog-food your own software and realize how bad of a programmer one is)...
Presently,
pyiem.database.get_dbconnstrdoes a lot of "magic" without any consideration of environment variables to control how the database user is guessed, when not provided. Well, whenpyiemis called from external software, this isn't a huge deal as developers can pass auser=parameter. The issue is whenpyiemitself calls the API internally, this has no knobs to control and only works if one of the hard-wiredUSERNAME_MAPPERhits. We can do better than this, maybe.