From c9b96ac756486b2d038775deb82b0e28ee607534 Mon Sep 17 00:00:00 2001 From: Michael Skarbek Date: Mon, 15 Apr 2024 16:17:11 -0400 Subject: [PATCH] [COST-4626] strip `acct` from schema in parquet converter (#5039) * strip acct from schema in parquet converter * remove schema-context --- .../api/upgrade_trino/util/verify_parquet_files.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/koku/masu/api/upgrade_trino/util/verify_parquet_files.py b/koku/masu/api/upgrade_trino/util/verify_parquet_files.py index 71575642a7..71979c4eab 100644 --- a/koku/masu/api/upgrade_trino/util/verify_parquet_files.py +++ b/koku/masu/api/upgrade_trino/util/verify_parquet_files.py @@ -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 @@ -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 @@ -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))