Skip to content

Commit

Permalink
all None as sub-value in classifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed Feb 3, 2025
1 parent 8d3cc3c commit f573e4a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion skydriver/database/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def post(
scanner_server_args: str,
tms_args_list: list[str],
env_vars: schema.EnvVars,
classifiers: dict[str, str | bool | float | int],
classifiers: dict[str, str | bool | float | int | None],
priority: int,
) -> schema.Manifest:
"""Create `schema.Manifest` doc."""
Expand Down
2 changes: 1 addition & 1 deletion skydriver/database/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class Manifest(ScanIDDataclass):
)

# open to requestor
classifiers: dict[str, str | bool | float | int] = dc.field(default_factory=dict)
classifiers: dict[str, str | bool | float | int | None] = dc.field(default_factory=dict)

# i3 event -- grabbed by scanner central server
i3_event_id: str = "" # id to i3_event coll
Expand Down
6 changes: 3 additions & 3 deletions skydriver/rest_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,12 @@ def _validate_request_clusters(
return list_tups


def _classifiers_validator(val: Any) -> dict[str, str | bool | float | int]:
def _classifiers_validator(val: Any) -> dict[str, str | bool | float | int | None]:
# type checks
if not isinstance(val, dict):
raise argparse.ArgumentTypeError("must be a dict")
if any(v for v in val.values() if not isinstance(v, str | bool | float | int)):
raise argparse.ArgumentTypeError("entry must be 'str | bool | float | int'")
if any(v for v in val.values() if not isinstance(v, str | bool | float | int | None)):
raise argparse.ArgumentTypeError("entry must be 'str | bool | float | int | None'")

# size check
if len(val) > MAX_CLASSIFIERS_LEN:
Expand Down

0 comments on commit f573e4a

Please sign in to comment.