This repository has been archived by the owner on Aug 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Repairing numBytes issue. numBytes is now showing exact numBytes from… #22
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… backup table in Big Query (not source table). Now, bbq is querying for backup table metadata (instead of source table). Thanks to that, numBytes shows exact number of Bytes for backupTable - it makes our Datastore entries more consistent (earlier numBytes could change between copyJob start and creating Backup entity). Note: as targetTableId doesn't contains partition, above imoplementation seems to be invalid, but we always backup partition into their own table -> so size of whole table equals to size of single partition in case of backups. Some refactorings (using data from copyJob configuration). Update unit tests to be consistent (the same data in 'given part' and in used CopyJobResult example)
radkomateusz
requested review from
marcin-kolda,
przemyslaw-jasinski,
jarekdrabek and
MZatorski
July 30, 2018 09:57
Pull Request Test Coverage Report for Build 387
💛 - Coveralls |
marcin-kolda
suggested changes
Aug 3, 2018
else: | ||
logging.info( | ||
"Source table {0} not exist. Backup entity is not created".format( | ||
source_table_reference)) | ||
"Backup table {0} not exist. Backup entity is not created".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If backup doesn't exist we should raise error via Error Reporting
@@ -35,6 +36,16 @@ def source_bq_table(self): | |||
return BigQueryTable(self.source_project_id, self.source_dataset_id, | |||
self.source_table_id) | |||
|
|||
@property | |||
def source_table_reference(self): | |||
table_id, partition_id = BigQueryTable \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move this implementation to BigQueryTable class. Then you could have:
return self.source_bq_table.get_table_reference()
… but copy job was return as success. Moving creation of table_reference based on bq_table to Table reference class (moving it to BQTable causes cyclic reference errors). Repairs unit tests to not require internet connection. Some method was renamed to achieve consistency with updates.
marcin-kolda
approved these changes
Aug 7, 2018
jarekdrabek
approved these changes
Aug 13, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… backup table in Big Query (not source table).
Now, bbq is querying for backup table metadata (instead of source table). Thanks to that, numBytes shows exact number of Bytes for backupTable - it makes our Datastore entries more consistent (earlier numBytes could change between copyJob start and creating Backup entity).
Note: as targetTableId doesn't contains partition, above imoplementation seems to be invalid, but we always backup partition into their own table -> so size of whole table equals to size of single partition in case of backups.
Some refactorings (using data from copyJob configuration).
Update unit tests to be consistent (the same data in 'given part' and in used CopyJobResult example)