Skip to content

Commit 760b7e4

Browse files
committed
Improved docstr
1 parent daf9c00 commit 760b7e4

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

services/common/rs_server_common/data_retrieval/eodag_provider.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -116,30 +116,32 @@ def __init__(self, config_file: Path, provider: str): # type: ignore
116116

117117
def _specific_search(self, **kwargs) -> Union[SearchResult, List]:
118118
"""
119-
Conducts a search for products within a specified time range.
119+
Conducts a search for products using the specified OData arguments.
120120
121-
This private method interfaces with the client's search functionality,
122-
retrieving products that fall within the given time range. The 'between'
123-
parameter is expected to be a TimeRange object, encompassing start and end
124-
timestamps. The method returns a dictionary of products keyed by their
125-
respective identifiers.
121+
This private method interfaces with the EODAG client's search functionality
122+
to retrieve products that match the given search parameters. It handles
123+
special cases such as `PublicationDate` and session ID lists while enforcing
124+
pagination constraints as per provider limitations.
126125
127126
Args:
128-
date_time: An object representing search datetime, can be fixed or open/closed interval.
127+
**kwargs: Arbitrary keyword arguments specifying search parameters,
128+
including all queryables defined in the provider's configuration as OData arguments.
129129
130130
Returns:
131-
SearchResult: A dictionary where keys are product identifiers and
132-
values are EOProduct instances.
133-
134-
Note:
135-
The time format of the 'between' parameter should be verified or formatted
136-
appropriately before invoking this method. The method also assumes that the
137-
client's search function is correctly set up to handle the provided time
138-
range format.
131+
Union[SearchResult, List]: A `SearchResult` object containing the matched products
132+
or an empty list if no matches are found.
139133
140134
Raises:
141-
Exception: If the search encounters an error or fails, an exception is raised.
135+
HTTPException: If a validation error occurs in the search query.
136+
SearchProductFailed: If the search request fails due to request errors,
137+
misconfiguration, or authentication issues.
138+
ValueError: If authentication with EODAG fails.
139+
140+
Notes:
141+
- Ensures compliance with provider-specific constraints, such as pagination limits.
142+
- Logs encountered errors and provides detailed messages in case of failures.
142143
"""
144+
143145
mapped_search_args: Dict[str, Union[str, None]] = {}
144146
if session_id := kwargs.pop("SessionId", None):
145147
# Map session_id to the appropriate eodag parameter

0 commit comments

Comments
 (0)