Fixes #21941: Use awsSessionToken as plain str in OpenSearch connector#27465
Conversation
…get_secret_value() (open-metadata#21941)
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
There was a problem hiding this comment.
Pull request overview
Fixes ingestion failures for the OpenSearch connector when using AWS temporary credentials by treating awsSessionToken as a plain string (per the AWSCredentials schema), avoiding an invalid .get_secret_value() call.
Changes:
- Update OpenSearch AWS IAM auth to pass
awsSessionTokendirectly asstr. - Minor formatting adjustment in Basic Auth tuple construction (no behavioral change).
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
🟡 Playwright Results — all passed (21 flaky)✅ 3666 passed · ❌ 0 failed · 🟡 21 flaky · ⏭️ 89 skipped
🟡 21 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
- Updated pyproject.toml to exclude virtual environments from black and pycln. - Standardized import sorting in test_opensearch.py to satisfy checkstyle.
66851a6 to
6428120
Compare
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Gitar
|



Describe your changes:
Fixes #21941
Summary: Ingestion was failing when using AWS temporary credentials (Access Key + Secret + Session Token) because the code was attempting to call .get_secret_value() on the awsSessionToken field.
Root Cause: In the awsCredentials.json schema, awsSessionToken is defined as a plain string (without format: password). This means the generated Pydantic model treats it as a standard Python str, which does not have the .get_secret_value() method. This resulted in an AttributeError whenever a session token was provided.
Changes:
Updated connection.py to use awsSessionToken directly as a plain string.
This change aligns the OpenSearch connector with how other AWS-based connectors (like Athena and the base AWS Client) handle this field.
How I tested:
Applied formatting via black.
Type of change:
Checklist:
Fixes #21941: Use awsSessionToken as plain str in OpenSearch connectorSummary by Gitar
OpenSearchConnectionTestintest_opensearch.pyto verify AWS authentication with a session token.This will update automatically on new commits.