Skip to content

Commit

Permalink
Typing annotations: rule.py (#6516)
Browse files Browse the repository at this point in the history
* Rules: remove unnecessary arguments in __find_surplus_locks_and_remove_them

* Rules: add type hints; #6454

* Rules: update query to SQLAlchemy 2.0 syntax; #6057

* Rules: Add RuleDict typed dict; #6454
  • Loading branch information
rdimaio committed Mar 7, 2024
1 parent e85183f commit 7531ef8
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 80 deletions.
17 changes: 16 additions & 1 deletion lib/rucio/common/types.py
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any, Callable, Optional, TypedDict, Union
from typing import Any, Callable, Literal, Optional, TypedDict, Union


class InternalType(object):
Expand Down Expand Up @@ -159,3 +159,18 @@ class RSESettingsDict(TypedDict):
deterministic: bool
domain: list[str]
protocols: list[RSEProtocolDict]


class RuleDict(TypedDict):
account: InternalAccount
copies: int
rse_expression: str
grouping: Literal['ALL', 'DATASET', 'NONE']
weight: str
lifetime: int
locked: bool
subscription_id: str
source_replica_expression: Optional[str]
activity: str
notify: Optional[Literal['Y', 'N', 'C']]
purge_replicas: bool

0 comments on commit 7531ef8

Please sign in to comment.