Skip to content

Filter out empty results in history API#25633

Merged
balloob merged 1 commit into
devfrom
history-empty-results
Aug 1, 2019
Merged

Filter out empty results in history API#25633
balloob merged 1 commit into
devfrom
history-empty-results

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob commented Aug 1, 2019

Description:

Make sure that the history results never contain an empty state set for an entity.

CC @thomasloven

Related issue (if applicable): fixes issue reported by @VDRainer

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@balloob balloob added this to the 0.97.0 milestone Aug 1, 2019
@balloob balloob requested a review from a team as a code owner August 1, 2019 17:09
@ghost
Copy link
Copy Markdown

ghost commented Aug 1, 2019

Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration (history) you are listed as a codeowner for? Thanks!

This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people.

assert response.status == 200


async def test_fetch_period_api_with_include_order(hass, hass_client):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just to confirm - this is a test for something else, right? not the introduced functionality? I don't see it validating the results, other than HTTP status.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The request failed before my fix, because it assumed each entry for an entity had at least 1 state. It does indeed not validate the results.

@balloob balloob merged commit 3649a1b into dev Aug 1, 2019
@delete-merged-branch delete-merged-branch Bot deleted the history-empty-results branch August 1, 2019 18:53
balloob added a commit that referenced this pull request Aug 1, 2019
@lock lock Bot locked and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants