Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
guenp committed Feb 10, 2025
1 parent 4ecf192 commit c0b26a9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/functional/adapter/test_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,21 @@ def extroot(self, tmp_path_factory, dest):
extroot = str(tmp_path_factory.getbasetemp() / "external")
if not os.path.exists(extroot):
os.mkdir(extroot)
return extroot

elif dest == DEST_S3:
extroot = os.path.join("dbt-duckdb", "test_external", f"pytest-{uuid4()}")
yield os.path.join("s3://", BUCKET_NAME, extroot)
s3_path = os.path.join("dbt-duckdb", "test_external", f"pytest-{uuid4()}")
extroot = os.path.join("s3://", BUCKET_NAME, s3_path)

yield extroot

if dest == DEST_S3:
session = boto3.Session(
aws_access_key_id=os.getenv("S3_MD_ORG_KEY"),
aws_secret_access_key=os.getenv("S3_MD_ORG_SECRET"),
)
s3 = session.resource('s3')
bucket = s3.Bucket('md-ecosystem-public')
bucket.objects.filter(Prefix=extroot).delete()
bucket.objects.filter(Prefix=s3_path).delete()

@pytest.fixture(scope="class")
def dbt_profile_target(self, profile_type, dbt_profile_target, extroot):
Expand Down

0 comments on commit c0b26a9

Please # to comment.