From b7ed013ced6ee87ce23051d9005d8a9b4d6e676c Mon Sep 17 00:00:00 2001 From: William Ransohoff <5217539+WRansohoff@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:15:32 -0400 Subject: [PATCH] More API token dataclass linting. --- axiom/tokens.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/axiom/tokens.py b/axiom/tokens.py index 13b4b3f..fc8fdf3 100644 --- a/axiom/tokens.py +++ b/axiom/tokens.py @@ -4,6 +4,7 @@ @dataclass class TokenDatasetCapabilities: + # pylint: disable=unsubscriptable-object """ TokenDatasetCapabilities describes the dataset-level permissions which a token can be assigned. @@ -12,17 +13,22 @@ class TokenDatasetCapabilities: """ # Ability to ingest data. Optional. - ingest: list[Literal["create"]] | None = None + ingest: Optional[list[Literal["create"]]] = field(default=None) # Ability to query data. Optional. - query: list[Literal["read"]] | None = None + query: Optional[list[Literal["read"]]] = field(default=None) # Ability to use starred queries. Optional. - starredQueries: list[Literal["create", "read", "update", "delete"]] | None = None + starredQueries: Optional[list[Literal["create", "read", "update", "delete"]]] = ( + field(default=None) + ) # Ability to use virtual fields. Optional. - virtualFields: list[Literal["create", "read", "update", "delete"]] | None = None + virtualFields: Optional[list[Literal["create", "read", "update", "delete"]]] = ( + field(default=None) + ) @dataclass class TokenOrganizationCapabilities: + # pylint: disable=unsubscriptable-object """ TokenOrganizationCapabilities describes the org-level permissions which a token can be assigned. @@ -80,6 +86,7 @@ class TokenOrganizationCapabilities: @dataclass class TokenAttributes: + # pylint: disable=unsubscriptable-object """ TokenAttributes describes the set of input parameters that the POST /tokens API accepts.