Skip to content

Commit

Permalink
style: generic re.Match type for hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunato committed Jan 17, 2025
1 parent 8d33327 commit 23ecdc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions eodag/plugins/crunch/filter_latest_tpl_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import logging
import re
from typing import TYPE_CHECKING, Any, Match, Optional, cast
from typing import TYPE_CHECKING, Any, Optional, cast

from eodag.plugins.crunch.base import Crunch
from eodag.utils.exceptions import ValidationError
Expand Down Expand Up @@ -66,7 +66,7 @@ def proceed(
filtered: list[EOProduct] = []
for product in products:
match = cast(
Optional[Match[Any]],
Optional[re.Match[Any]],
self.name_pattern.match(product.properties["title"]),
)
if match:
Expand Down
4 changes: 2 additions & 2 deletions eodag/plugins/download/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from datetime import datetime
from itertools import chain
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Iterator, Match, Optional, Union, cast
from typing import TYPE_CHECKING, Any, Callable, Iterator, Optional, Union, cast

import boto3
import requests
Expand Down Expand Up @@ -1118,7 +1118,7 @@ def get_chunk_dest_path(
s1_title_suffix: Optional[str] = None
# S2 common
if product.product_type and "S2_MSI" in product.product_type:
title_search: Optional[Match[str]] = re.search(
title_search: Optional[re.Match[str]] = re.search(
r"^\w+_\w+_(\w+)_(\w+)_(\w+)_(\w+)_(\w+)$",
product.properties["title"],
)
Expand Down

0 comments on commit 23ecdc2

Please sign in to comment.