project-koku / masu

This is a READ ONLY repo. See https://github.com/project-koku/koku for current masu implementation
GNU Affero General Public License v3.0
5 stars 6 forks source link

Fix case where summarization blows up on missing data #479

Closed adberglund closed 5 years ago

adberglund commented 5 years ago

Summary

This makes a WHERE clause expecting bill_ids to be fully optional so that the SQL does not blow up with a syntax error looking for bill_id IN (). This shouldn't be a case that happens in the normal business flow, but when running the report data summary API it triggers AWS providers with no data and blows up.

codecov[bot] commented 5 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@364a42f). Click here to learn what that means. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master    #479   +/-   ##
========================================
  Coverage          ?   97.6%           
========================================
  Files             ?      67           
  Lines             ?    3894           
  Branches          ?     418           
========================================
  Hits              ?    3800           
  Misses            ?      50           
  Partials          ?      44
Impacted Files Coverage Δ
masu/processor/tasks.py 92.8% <ø> (ø)
masu/database/aws_report_db_accessor.py 98.5% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 364a42f...e92b3a7. Read the comment docs.

blentz commented 5 years ago

LGTM. Once the coverage checks are passing, I can :+1:

adberglund commented 5 years ago

This covered an issue that only occurred when running the report_data API for all providers. It would trigger a run against an AWS provider and if that provider existed but had no data, it would crash. This fixes that so we no longer crash in this case.