Fix ENV_API_DEFAULT_REQ_METHOD no default value causes ValueError if not specified

This commit is contained in:
allegroai 2022-01-31 12:39:39 +02:00
parent d39e30995a
commit 771690d5c0
2 changed files with 2 additions and 1 deletions

View File

@ -26,4 +26,4 @@ POST requests can be used instead.
However this has not been vigorously tested and may have unintended consequences.
"""
ENV_API_DEFAULT_REQ_METHOD = EnvEntry("CLEARML_API_DEFAULT_REQ_METHOD")
ENV_API_DEFAULT_REQ_METHOD = EnvEntry("CLEARML_API_DEFAULT_REQ_METHOD", default="GET")

View File

@ -13,6 +13,7 @@ if ENV_API_DEFAULT_REQ_METHOD.get().upper() not in ("GET", "POST"):
"CLEARML_API_DEFAULT_REQ_METHOD environment variable must be 'get' or 'post' (any case is allowed)."
)
class Request(ApiModel):
_method = ENV_API_DEFAULT_REQ_METHOD.get(default="get")