Skip to content

Commit

Permalink
Merge pull request #163 from developmentseed/backport/fix-streaming-r…
Browse files Browse the repository at this point in the history
…esponse

[backport] fix streaming response
  • Loading branch information
vincentsarago authored Jan 10, 2024
2 parents 2e03692 + 9c25a27 commit b9608a6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).

Note: Minor version `0.X.0` update might break the API, It's recommended to pin `tipg` to minor version: `tipg>=0.1,<0.2`

## [0.5.8] - 2024-01-10

- fix invalid streaming response formatting [backported from 0.6.0]

## [0.5.7] - 2024-01-08

- add `tags` to all routes
Expand Down
26 changes: 17 additions & 9 deletions tipg/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,19 +753,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 b9608a6

Please sign in to comment.