eodag 3.4.1.post1__py3-none-any.whl → 3.4.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,6 +49,7 @@ from eodag.utils import (
49
49
  get_timestamp,
50
50
  items_recursive_apply,
51
51
  nested_pairs2dict,
52
+ remove_str_array_quotes,
52
53
  sanitize,
53
54
  string_to_jsonpath,
54
55
  update_nested_dict,
@@ -1317,6 +1318,10 @@ def format_query_params(
1317
1318
  # retrieve values from hashes where keys are given in the param
1318
1319
  if "}[" in formatted_query_param:
1319
1320
  formatted_query_param = _resolve_hashes(formatted_query_param)
1321
+ # remove quotes around arrays
1322
+ formatted_query_param = remove_str_array_quotes(
1323
+ formatted_query_param
1324
+ )
1320
1325
  # json query string (for POST request)
1321
1326
  update_nested_dict(
1322
1327
  query_params,
@@ -369,6 +369,9 @@ class Search(PluginTopic):
369
369
  if not product_type
370
370
  else ""
371
371
  )
372
+ discover_metadata = getattr(self.config, "discover_metadata", {})
373
+ auto_discovery = discover_metadata.get("auto_discovery", False)
374
+
372
375
  if product_type or getattr(self.config, "discover_queryables", {}).get(
373
376
  "fetch_url", ""
374
377
  ):
@@ -376,6 +379,7 @@ class Search(PluginTopic):
376
379
  self.config.product_type_config = product_type_configs[product_type]
377
380
  queryables = self._get_product_type_queryables(product_type, alias, filters)
378
381
  queryables.additional_information = additional_info
382
+ queryables.additional_properties = auto_discovery
379
383
 
380
384
  return queryables
381
385
  else:
@@ -390,7 +394,7 @@ class Search(PluginTopic):
390
394
  Queryables.model_fields.get(k, Field(None)), "default", None
391
395
  )
392
396
  return QueryablesDict(
393
- additional_properties=True,
397
+ additional_properties=auto_discovery,
394
398
  additional_information=additional_info,
395
399
  **all_queryables,
396
400
  )
@@ -470,7 +470,7 @@ class ECMWFSearch(PostJsonSearch):
470
470
  self.config.__dict__.setdefault(
471
471
  "discover_metadata",
472
472
  {
473
- "auto_discovery": True,
473
+ "auto_discovery": False,
474
474
  "search_param": "{metadata}",
475
475
  "metadata_pattern": "^[a-zA-Z0-9][a-zA-Z0-9_]*$",
476
476
  },
@@ -1179,6 +1179,9 @@ class ECMWFSearch(PostJsonSearch):
1179
1179
  + "_ORDERABLE_"
1180
1180
  + query_hash
1181
1181
  )
1182
+ # use product_type_config as default properties
1183
+ product_type_config = getattr(self.config, "product_type_config", {})
1184
+ properties = dict(product_type_config, **properties)
1182
1185
 
1183
1186
  qs = geojson.dumps(sorted_unpaginated_qp)
1184
1187
 
@@ -1222,6 +1225,9 @@ def _check_id(product: EOProduct) -> EOProduct:
1222
1225
  if not (product_id := product.search_kwargs.get("id")):
1223
1226
  return product
1224
1227
 
1228
+ if "ORDERABLE" in product_id:
1229
+ return product
1230
+
1225
1231
  on_response_mm = getattr(product.downloader.config, "order_on_response", {}).get(
1226
1232
  "metadata_mapping", {}
1227
1233
  )
@@ -1442,6 +1448,9 @@ class MeteoblueSearch(ECMWFSearch):
1442
1448
  productType=product_type,
1443
1449
  properties=properties,
1444
1450
  )
1451
+ # use product_type_config as default properties
1452
+ product_type_config = getattr(self.config, "product_type_config", {})
1453
+ product.properties = dict(product_type_config, **product.properties)
1445
1454
 
1446
1455
  return [
1447
1456
  product,
@@ -285,6 +285,9 @@ class CopMarineSearch(StaticStacSearch):
285
285
  }
286
286
  }
287
287
  product = EOProduct(self.provider, properties, productType=product_type)
288
+ # use product_type_config as default properties
289
+ product_type_config = getattr(self.config, "product_type_config", {})
290
+ product.properties = dict(product_type_config, **product.properties)
288
291
  product.assets = AssetsDict(product, assets)
289
292
  return product
290
293