Skip to content

fix: Correct sharded table prefix extraction in Bigquery Usage Extractor #1980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def _create_records(self, refResources: List[dict], resourcesProcessed: int, ema
tableId = self._remove_table_decorators(tableId)

if self._is_sharded_table(tableId):
tableId = tableId[:-BigQueryTableUsageExtractor.DATE_LENGTH]
# Use the prefix of the sharded table as tableId
tableId = tableId[:-len(self._get_sharded_table_suffix(tableId))]

if refResource['projectId'] != self.project_id and self.count_reads_only_from_same_project:
LOGGER.debug(
Expand Down