diff --git a/dbos/_dbos_config.py b/dbos/_dbos_config.py index 9eb66da3..5f267eee 100644 --- a/dbos/_dbos_config.py +++ b/dbos/_dbos_config.py @@ -198,4 +198,4 @@ def _app_name_to_db_name(app_name: str) -> str: def _set_env_vars(config: ConfigFile) -> None: for env, value in config.get("env", {}).items(): if value is not None: - os.environ[env] = value + os.environ[env] = str(value) diff --git a/tests/test_config.py b/tests/test_config.py index 1bf41f59..e8fe4087 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -44,6 +44,7 @@ def test_valid_config(mocker): foo: ${BARBAR} bazbaz: BAZBAZ bob: ${BOBBOB} + test_number: 123 """ os.environ["BARBAR"] = "FOOFOO" mocker.patch( @@ -61,10 +62,12 @@ def test_valid_config(mocker): assert configFile["database"]["connectionTimeoutMillis"] == 3000 assert configFile["env"]["foo"] == "FOOFOO" assert configFile["env"]["bob"] is None # Unset environment variable + assert configFile["env"]["test_number"] == 123 _set_env_vars(configFile) assert os.environ["bazbaz"] == "BAZBAZ" assert os.environ["foo"] == "FOOFOO" + assert os.environ["test_number"] == "123" assert "bob" not in os.environ