Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Working POC for filtering not existing tables from SLI view. #34

Merged
merged 14 commits into from
Aug 31, 2018

Conversation

radkomateusz
Copy link
Contributor

YACHT-964: Working POC for filtering not existing tables from SLI view.

TODO:

  • unit tests
  • refactor to do it the same for SLI 4,5 and 7 days without copy paste
  • define format in which result will be streamed into BQ

TODO:
- unit tests
- refactor to do it the same for SLI 4,5 and 7 days without copy paste
- define format in which result will be streamed into BQ
@coveralls
Copy link

coveralls commented Aug 17, 2018

Pull Request Test Coverage Report for Build 499

  • 39 of 84 (46.43%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.02%) to 80.007%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/slo/slo_handlers.py 0 6 0.0%
src/slo/x_days_sli/sli_results_streamer.py 0 8 0.0%
src/slo/x_days_sli/slo_x_days_handlers.py 0 8 0.0%
src/slo/x_days_sli/x_days_sli_service.py 0 23 0.0%
Totals Coverage Status
Change from base Build 477: -1.02%
Covered Lines: 2217
Relevant Lines: 2771

💛 - Coveralls

self.bigQuery = BigQuery()

def query(self, x_days):
query_results = self.bigQuery.execute_query("""SELECT * FROM [project-bbq:SLO_views_legacy.SLI_3_days]""")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please retrieve this id from configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

filtered_results = [table for table in query_results if self.table_exists(table)]
return filtered_results

def table_exists(self, result):
Copy link
Contributor

Choose a reason for hiding this comment

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

This method should accept table reference

def __exists(self, table):
return self.filter.exists(self.__create_table_reference(table))

def __create_table_reference(self, table):
Copy link
Contributor

Choose a reason for hiding this comment

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

IntelliJ says it may be static :)

@przemyslaw-jasinski przemyslaw-jasinski merged commit 1e23575 into master Aug 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants