mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-02 11:39:12 +00:00
Fix: Revert Athena tests and types change (#8909)
This commit is contained in:
parent
effba5e170
commit
27997b2f77
@ -476,9 +476,7 @@ def _(connection: AthenaConnection):
|
||||
url += ":"
|
||||
url += f"@athena.{connection.awsConfig.awsRegion}.amazonaws.com:443"
|
||||
|
||||
staging_url = connection.s3StagingDir.scheme + "://" + str(connection.s3StagingDir)
|
||||
|
||||
url += f"?s3_staging_dir={quote_plus(staging_url)}"
|
||||
url += f"?s3_staging_dir={quote_plus(connection.s3StagingDir)}"
|
||||
if connection.workgroup:
|
||||
url += f"&work_group={connection.workgroup}"
|
||||
if connection.awsConfig.awsSessionToken:
|
||||
|
||||
@ -11,8 +11,6 @@
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from pydantic import AnyUrl
|
||||
|
||||
from metadata.generated.schema.entity.services.connections.database.athenaConnection import (
|
||||
AthenaConnection,
|
||||
AthenaScheme,
|
||||
@ -768,20 +766,20 @@ class SouceConnectionTest(TestCase):
|
||||
awsAccessKeyId="key", awsRegion="us-east-2", awsSecretAccessKey="secret_key"
|
||||
)
|
||||
|
||||
expected_url = "awsathena+rest://key:secret_key@athena.us-east-2.amazonaws.com:443?s3_staging_dir=s3%3A%2F%2Fs3athena-postgres&work_group=primary"
|
||||
expected_url = "awsathena+rest://key:secret_key@athena.us-east-2.amazonaws.com:443?s3_staging_dir=s3%3A%2F%2Fpostgres%2Finput%2F&work_group=primary"
|
||||
athena_conn_obj = AthenaConnection(
|
||||
awsConfig=awsCreds,
|
||||
s3StagingDir=AnyUrl("s3athena-postgres", scheme="s3"),
|
||||
s3StagingDir="s3://postgres/input/",
|
||||
workgroup="primary",
|
||||
scheme=AthenaScheme.awsathena_rest,
|
||||
)
|
||||
assert expected_url == get_connection_url(athena_conn_obj)
|
||||
|
||||
# connection arguments with db
|
||||
expected_url = "awsathena+rest://key:secret_key@athena.us-east-2.amazonaws.com:443?s3_staging_dir=s3%3A%2F%2Fs3athena-postgres&work_group=primary"
|
||||
# connection arguments witho db
|
||||
expected_url = "awsathena+rest://key:secret_key@athena.us-east-2.amazonaws.com:443?s3_staging_dir=s3%3A%2F%2Fpostgres%2Fintput%2F&work_group=primary"
|
||||
athena_conn_obj = AthenaConnection(
|
||||
awsConfig=awsCreds,
|
||||
s3StagingDir=AnyUrl("s3athena-postgres", scheme="s3"),
|
||||
s3StagingDir="s3://postgres/intput/",
|
||||
workgroup="primary",
|
||||
scheme=AthenaScheme.awsathena_rest,
|
||||
)
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
},
|
||||
"s3StagingDir": {
|
||||
"title": "S3 Staging Directory",
|
||||
"description": "S3 Staging Directory.",
|
||||
"description": "S3 Staging Directory. Example: s3://postgres/input/",
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user