Prevent possible errors when exporting datasets in GDPR tool #19056
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.
Description:
When exporting datasets in the GDPR tool we try to format all columns that are exported.
This is done by checking for matching dimensions. In some cases this causes problems, as the dimensions actually don't have a format method that can format the raw column value (as they define a sql segment that should be applied).
This currently happens e.g. when exporting a dataset that contains some media actions, as the
Hour
dimension is used forserver_time
column.This PR drops using dimensions for formatting if they define a special sql segment.
In addition it catches possible exceptions thrown while formatting and using the unformatted raw value instead. Possible exceptions will be logged so we still might notice possible problems.
Review