You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.0.0 introduces DBConfig as a TypedDict, specified as:
class DBConfig(TypedDict, total=False):
...
OPTIONS: Optional[Dict[str, Any]]
As far as I can tell from a cursory reading of parse, it cannot be Optional (None) - options is always at least an empty directory ({}), but it can be NotRequired as a key (which is AFAIK already handled by the class being total=False) because if it is empty it just won't be set.
This came up for me because I have some code which does:
if "OPTIONS" in parsed_db_config:
parsed_db_config["OPTIONS"].update(...some_stuff)
which gets raised as an error:
error: Item "None" of "Optional[Dict[str, Any]]" has no attribute "update" [union-attr]
Here's the totality of options being used and then potentially bound to the OPTIONS key:
2.0.0
introducesDBConfig
as aTypedDict
, specified as:As far as I can tell from a cursory reading of
parse
, it cannot beOptional
(None
) -options
is always at least an empty directory ({}
), but it can beNotRequired
as a key (which is AFAIK already handled by the class beingtotal=False
) because if it is empty it just won't be set.This came up for me because I have some code which does:
which gets raised as an error:
Here's the totality of
options
being used and then potentially bound to theOPTIONS
key:dj-database-url/dj_database_url/__init__.py
Lines 159 to 182 in 9b0f325
The text was updated successfully, but these errors were encountered: