Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch/do not exclude null properties #160

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]]
):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we first check if we have any data with geometry

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"]
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we can safely ignore geometry because of the previous test


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