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
The code is running fine after i removing all default
from enum import Enum
from typing import Optional
def Query(any_object):
return any_object
class Environment(Enum):
DEV = "DEV"
UAT = "UAT"
TEST = "TEST"
PROD = "PROD"
class ListOut:
pass
def list_items(
usecase_id: Optional[str] = Query(None),
environment: Optional[Environment] = Query(None), #made changes in these lines
asset_id: Optional[str] = Query(None)
) -> ListOut:
match (usecase_id, environment, asset_id):
case (None, None, None):
out = ListOut()
case (uc, None, None):
out = ListOut()
case (None, e, None) if e:
out = ListOut()
case (None, None, a) if a:
out = ListOut()
case (None, e, a) if e and a:
out = ListOut()
case (u, e, None) if u and e:
out = ListOut()
case (u, None, a) if u and a:
out = ListOut()
case (uc, e, a):
out = ListOut()
return out
The code is running fine after i removing all default
from enum import Enum
from typing import Optional
def Query(any_object):
return any_object
class Environment(Enum):
DEV = "DEV"
UAT = "UAT"
TEST = "TEST"
PROD = "PROD"
class ListOut:
pass
def list_items(
usecase_id: Optional[str] = Query(None),
environment: Optional[Environment] = Query(None), #made changes in these lines
asset_id: Optional[str] = Query(None)
) -> ListOut:
match (usecase_id, environment, asset_id):
case (None, None, None):
out = ListOut()
case (uc, None, None):
out = ListOut()
case (None, e, None) if e:
out = ListOut()
case (None, None, a) if a:
out = ListOut()
case (None, e, a) if e and a:
out = ListOut()
case (u, e, None) if u and e:
out = ListOut()
case (u, None, a) if u and a:
out = ListOut()
case (uc, e, a):
out = ListOut()
return out
Origin code:
Query(default=None),
environment: Optional[Environment] = Query(default=None),
asset_id: Optional[str] = Query(default=None)
The text was updated successfully, but these errors were encountered: