-
Notifications
You must be signed in to change notification settings - Fork 18
[COST-6067] Fix incorrect labels' structure in GCP JSONLPersistentDiskGenerator #584
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
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReorder labels assignment in JSONLPersistentDiskGenerator to occur after attribute overrides, aligning with ComputeEngine logic and preventing incorrect label structures in BigQuery. Class diagram for updated labels assignment in JSONLPersistentDiskGeneratorclassDiagram
class JSONLPersistentDiskGenerator {
+_update_data(row)
+generate_data(report_type=None)
+determine_labels(LABELS)
attributes
LABELS
column_labels
_resource_name
_resource_global_name
_currency
}
JSONLPersistentDiskGenerator : _update_data(row) now assigns labels after attribute overrides
Flow diagram for labels assignment order in _update_dataflowchart TD
A[Start _update_data]
B[Set invoice, resource, currency]
C[Override attributes in row]
D[Assign labels using determine_labels]
E[Return row]
A --> B --> C --> D --> E
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #584 +/- ##
=====================================
Coverage 93.5% 93.5%
=====================================
Files 56 56
Lines 4677 4677
Branches 651 651
=====================================
+ Hits 4372 4373 +1
+ Misses 164 163 -1
Partials 141 141 🚀 New features to boost your workflow:
|
This PR fixes a bug where the JSONLPersistentDiskGenerator produced an inconsistent structure for the 'labels' field compared to other generators.
The issue was caused by the attribute override logic running after the default labels were set, causing correctly formatted labels to be overwritten. This change reorders the operations to match the logic in the ComputeEngine generator, ensuring a consistent key-value pair format for labels across all generated data. This resolves JSON parsing errors in BigQuery.
== Assisted by Gemini ==
Summary by Sourcery
Reorder label determination in JSONLPersistentDiskGenerator to fix inconsistent labels and align with ComputeEngine logic
Bug Fixes:
Enhancements: