Skip to content

Commit b4613c1

Browse files
committed
change the return type of the load_yaml() function
1 parent 6ec6d8a commit b4613c1

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

app/utils.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
import typing as t
2-
31
import yaml
42
from models import AdditionalConfig
53

64

7-
def load_yaml() -> dict[str, t.Any]:
8-
with open("config.yaml") as stream:
9-
try:
10-
admin_config = yaml.safe_load(stream)
11-
return AdditionalConfig(**admin_config)
12-
except yaml.YAMLError as exc:
13-
raise exc
5+
def load_yaml() -> AdditionalConfig:
6+
with open("config.yaml") as file:
7+
admin_config = yaml.safe_load(file)
8+
return AdditionalConfig(**admin_config)
149

1510

1611
additional_config = load_yaml()

0 commit comments

Comments
 (0)