Skip to content

Commit 4bddc44

Browse files
committed
run pre-commit
1 parent 40f6a5b commit 4bddc44

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/serializers.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def db_to_stac(cls, item: dict, base_url: str) -> stac_types.Item:
3838
return stac_types.Item(
3939
type="Feature",
4040
stac_version=item["stac_version"] if "stac_version" in item else "",
41-
stac_extensions=item["stac_extensions"] if "stac_extensions" in item else [],
41+
stac_extensions=item["stac_extensions"]
42+
if "stac_extensions" in item
43+
else [],
4244
id=item_id,
4345
collection=item["collection"] if "collection" in item else "",
4446
geometry=item["geometry"] if "geometry" in item else {},
@@ -66,10 +68,16 @@ def db_to_stac(cls, collection: dict, base_url: str) -> stac_types.Collection:
6668
return stac_types.Collection(
6769
type="Collection",
6870
id=collection["id"],
69-
stac_extensions=collection["stac_extensions"] if "stac_extensions" in collection else [],
70-
stac_version=collection["stac_version"] if "stac_version" in collection else "",
71+
stac_extensions=collection["stac_extensions"]
72+
if "stac_extensions" in collection
73+
else [],
74+
stac_version=collection["stac_version"]
75+
if "stac_version" in collection
76+
else "",
7177
title=collection["title"] if "title" in collection else "",
72-
description=collection["description"] if "description" in collection else "",
78+
description=collection["description"]
79+
if "description" in collection
80+
else "",
7381
keywords=collection["keywords"] if "keywords" in collection else [],
7482
license=collection["license"] if "license" in collection else "",
7583
providers=collection["providers"] if "providers" in collection else {},

stac_fastapi/mongo/stac_fastapi/mongo/serializers.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def db_to_stac(cls, item: dict, base_url: str) -> stac_types.Item:
3838
return stac_types.Item(
3939
type="Feature",
4040
stac_version=item["stac_version"] if "stac_version" in item else "",
41-
stac_extensions=item["stac_extensions"] if "stac_extensions" in item else [],
41+
stac_extensions=item["stac_extensions"]
42+
if "stac_extensions" in item
43+
else [],
4244
id=item_id,
4345
collection=item["collection"] if "collection" in item else "",
4446
geometry=item["geometry"] if "geometry" in item else {},
@@ -66,10 +68,16 @@ def db_to_stac(cls, collection: dict, base_url: str) -> stac_types.Collection:
6668
return stac_types.Collection(
6769
type="Collection",
6870
id=collection["id"],
69-
stac_extensions=collection["stac_extensions"] if "stac_extensions" in collection else [],
70-
stac_version=collection["stac_version"] if "stac_version" in collection else "",
71+
stac_extensions=collection["stac_extensions"]
72+
if "stac_extensions" in collection
73+
else [],
74+
stac_version=collection["stac_version"]
75+
if "stac_version" in collection
76+
else "",
7177
title=collection["title"] if "title" in collection else "",
72-
description=collection["description"] if "description" in collection else "",
78+
description=collection["description"]
79+
if "description" in collection
80+
else "",
7381
keywords=collection["keywords"] if "keywords" in collection else [],
7482
license=collection["license"] if "license" in collection else "",
7583
providers=collection["providers"] if "providers" in collection else {},

0 commit comments

Comments
 (0)