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

YACHT-1246: BBQ will not backup empty table if current newest backup … #137

Merged
merged 3 commits into from
Apr 18, 2019

Conversation

radkomateusz
Copy link
Contributor

…of given table is not empty and lastModification time is newer than date of newest backup

…of given table is not empty and lastModification time is newer than date of newest backup
@coveralls
Copy link

coveralls commented Apr 8, 2019

Pull Request Test Coverage Report for Build 1115

  • 7 of 7 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 84.24%

Totals Coverage Status
Change from base Build 1098: 0.005%
Covered Lines: 2416
Relevant Lines: 2868

💛 - Coveralls

@@ -45,6 +45,9 @@ def __is_table_backup_up_to_date(self, big_query_table_metadata, last_backup):
)
if source_table_last_modified_time > last_backup.last_modified:
logging.info("Backup time is older than table metadata")
if big_query_table_metadata.is_empty() and last_backup.numBytes > 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this should be separate method that returns True/False rather than additional "if" deep in the tree.
I think this answers different question then "is_table_backup_up_to_date"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved it to to main method. And refactored it a little.

…ness.

Adding test: Should make backup if source table is empty and existing backup is also empty (eg. schema change but without adding any data).
@radkomateusz radkomateusz merged commit 832900c into master Apr 18, 2019
@radkomateusz radkomateusz deleted the YACHT-1246 branch April 18, 2019 11:59
przemyslaw-jasinski pushed a commit that referenced this pull request Apr 23, 2019
YACHT-1246: BBQ will not backup empty table if current newest backup …
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