Skip to content

Commit

Permalink
[COST-4626] strip acct from schema in parquet converter (#5039)
Browse files Browse the repository at this point in the history
* strip acct from schema in parquet converter

* remove schema-context
  • Loading branch information
maskarb authored Apr 15, 2024
1 parent 44bb32e commit c9b96ac
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions koku/masu/api/upgrade_trino/util/verify_parquet_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import pyarrow.parquet as pq
from botocore.exceptions import ClientError
from django.conf import settings
from django_tenants.utils import schema_context

from api.common import log_json
from api.provider.models import Provider
Expand All @@ -29,7 +28,7 @@ class VerifyParquetFiles:
S3_PREFIX_LOG_KEY = "s3_prefix"

def __init__(self, schema_name, provider_uuid, provider_type, simulate, bill_date, cleaned_column_mapping):
self.schema_name = schema_name
self.schema_name = schema_name.replace("acct", "")
self.provider_uuid = uuid.UUID(provider_uuid)
self.provider_type = provider_type.replace("-local", "")
self.simulate = simulate
Expand Down Expand Up @@ -114,10 +113,9 @@ def _generate_s3_path_prefixes(self, bill_date):
"""
generates the s3 path prefixes.
"""
with schema_context(self.schema_name):
ocp_on_cloud_check = Provider.objects.filter(
infrastructure__infrastructure_provider__uuid=self.provider_uuid
).exists()
ocp_on_cloud_check = Provider.objects.filter(
infrastructure__infrastructure_provider__uuid=self.provider_uuid
).exists()
path_prefixes = set()
for report_type in self.report_types:
path_prefixes.add(self._parquet_path_s3(bill_date, report_type))
Expand Down

0 comments on commit c9b96ac

Please sign in to comment.