Skip to content

Commit

Permalink
Merge pull request #160 from developmentseed/patch/do-not-exclude-nul…
Browse files Browse the repository at this point in the history
…l-properties

Patch/do not exclude null properties
  • Loading branch information
vincentsarago authored Jan 9, 2024
2 parents 8483d54 + b0c9d14 commit 3d6a047
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions tipg/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,19 +754,27 @@ async def items( # noqa: C901
MediaType.json,
MediaType.ndjson,
):
rows = (
{
k: v
for k, v in {
if any(
[f.get("geometry", None) is not None for f in item_list["items"]]
):
rows = (
{
"collectionId": collection.id,
"itemId": f.get("id"),
**f.get("properties", {}),
"geometry": f.get("geometry", None),
}.items()
if v is not None
}
for f in item_list["items"]
)
}
for f in item_list["items"]
)
else:
rows = (
{
"collectionId": collection.id,
"itemId": f.get("id"),
**f.get("properties", {}),
}
for f in item_list["items"]
)

# CSV Response
if output_type == MediaType.csv:
Expand Down

0 comments on commit 3d6a047

Please sign in to comment.