Skip to content

Commit

Permalink
Removing. disk_size.
Browse files Browse the repository at this point in the history
  • Loading branch information
bacciotti committed Sep 11, 2024
1 parent 264072a commit f9285f0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
2 changes: 0 additions & 2 deletions nise/generators/gcp/compute_engine_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def _update_data(self, row): # noqa: C901
row["labels"] = self.determine_labels(self.LABELS)
row["system_labels"] = self.determine_system_labels(sku[3])
row["price.effective_price"] = choice(self.EFFECTIVE_PRICE)
row["disk_size"] = self._generate_disk_size(row["cost"], row["price.effective_price"])

if self.resource_level:
resource = self._generate_resource(
Expand Down Expand Up @@ -190,7 +189,6 @@ def _update_data(self, row): # noqa: C901
row["invoice"] = invoice
effective_price = choice(self.EFFECTIVE_PRICE)
row["price"] = {"effective_price": effective_price}
row["disk_size"] = self._generate_disk_size(row["cost"], row["price"]["effective_price"])

if self.resource_level:
resource = self._generate_resource()
Expand Down
12 changes: 0 additions & 12 deletions nise/generators/gcp/gcp_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"cost_type",
"partition_date",
"price.effective_price",
"disk_size",
)

GCP_RESOURCE_COLUMNS = ("resource.name", "resource.global_name")
Expand Down Expand Up @@ -321,14 +320,3 @@ def _generate_hourly_data(self, **kwargs):
row = self._init_data_row(start, end)
row = self._update_data(row)
yield row

def _generate_disk_size(self, cost, effective_price):
"""Generate disk size."""
hours_in_month = 744
disk_size = 0

if cost and effective_price:
rate = float(effective_price) / hours_in_month
disk_size = float(cost) / rate

return disk_size
1 change: 0 additions & 1 deletion nise/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ def gcp_bucket_to_dataset(gcp_bucket_name, file_name, dataset_name, table_name,
"fields": [{"name": "effective_price", "type": "STRING", "mode": "NULLABLE"}],
"mode": "NULLABLE",
},
{"name": "disk_size", "type": "STRING", "mode": "NULLABLE"},
{
"name": "adjustment_info",
"type": "RECORD",
Expand Down

0 comments on commit f9285f0

Please sign in to comment.