restrict return type more

This commit is contained in:
Sarah Hoffmann
2022-07-03 17:21:46 +02:00
parent fc03c0266a
commit f12fe54d2b

View File

@@ -7,7 +7,7 @@
""" """
Specialised connection and cursor functions. Specialised connection and cursor functions.
""" """
from typing import List, Optional, Any, Callable, ContextManager, Mapping, cast, overload, Tuple from typing import List, Optional, Any, Callable, ContextManager, Dict, Mapping, cast, overload, Tuple
import contextlib import contextlib
import logging import logging
import os import os
@@ -225,7 +225,7 @@ _PG_CONNECTION_STRINGS = {
def get_pg_env(dsn: str, def get_pg_env(dsn: str,
base_env: Optional[Mapping[str, str]] = None) -> Mapping[str, str]: base_env: Optional[Mapping[str, str]] = None) -> Dict[str, str]:
""" Return a copy of `base_env` with the environment variables for """ Return a copy of `base_env` with the environment variables for
PostgresSQL set up from the given database connection string. PostgresSQL set up from the given database connection string.
If `base_env` is None, then the OS environment is used as a base If `base_env` is None, then the OS environment is used as a base