Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmwf-cobarzan committed Dec 4, 2024
1 parent 8473f0f commit ff7c20b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cads_adaptors/adaptors/cds.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from cads_adaptors.validation import enforce



class AbstractCdsAdaptor(AbstractAdaptor):
resources = {"CADS_ADAPTORS": 1}
adaptor_schema: dict[str, Any] = {}
Expand Down Expand Up @@ -147,11 +146,15 @@ def ensure_list_values(self, dicts):
for key in d:
d[key] = ensure_list(d[key])

def satisfy_conditions(self, requests: list[dict[str, list[Any]]], conditions: list[dict[str, list[Any]]]):
def satisfy_conditions(
self,
requests: list[dict[str, list[Any]]],
conditions: list[dict[str, list[Any]]],
):
try:
_, d12, _ = hcubes_intdiff2(requests, conditions)
return not d12
except Exception as e:
except Exception:
return False

def normalise_request(self, request: Request) -> Request:
Expand Down Expand Up @@ -205,7 +208,9 @@ def normalise_request(self, request: Request) -> Request:
hidden_tag = f"__{tag}"
request[hidden_tag] = True
except Exception as e:
self.context.add_stdout(f"An error occured while attempting conditional tagging: {e!r}")
self.context.add_stdout(
f"An error occured while attempting conditional tagging: {e!r}"
)

# Map the list of requests
self.mapped_requests = [
Expand Down

0 comments on commit ff7c20b

Please sign in to comment.