Skip to content

fix the tutorial in AIConnectorHelper when fetching domain_url #3852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Zhangxunmt
Copy link
Collaborator

@Zhangxunmt Zhangxunmt commented May 15, 2025

Description

This fixes the error when calling describe_elasticsearch_domain to get domain_url for VPC domains. For VPC domains, the returned Endpoints is a Map rather than a String.
https://docs.aws.amazon.com/cli/latest/reference/es/describe-elasticsearch-domain.html

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

" domain_arn = domain_info['ARN']\n",
"\n",
" # Check if domain has VPC endpoints\n",
" if 'Endpoints' in domain_info:\n",
Copy link
Contributor

@nathaliellenaa nathaliellenaa May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used this logic to check for VPC endpoint in the connector CLI. Maybe you can try this out since this is simpler? (ref)

domain_url = (
    domain_info.get("Endpoint") or domain_info["Endpoints"]["vpc"]
)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Endpoints or vpc does not exist, it would throw KeyError if key doesn't exist so you need to run this tutorial from begin.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, that makes sense.

Copy link

codecov bot commented May 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.02%. Comparing base (f6a25f5) to head (ba049e7).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #3852   +/-   ##
=========================================
  Coverage     78.01%   78.02%           
- Complexity     7336     7337    +1     
=========================================
  Files           656      656           
  Lines         33074    33074           
  Branches       3708     3708           
=========================================
+ Hits          25804    25805    +1     
  Misses         5683     5683           
+ Partials       1587     1586    -1     
Flag Coverage Δ
ml-commons 78.02% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Zhangxunmt Zhangxunmt had a problem deploying to ml-commons-cicd-env May 15, 2025 18:24 — with GitHub Actions Failure
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env May 15, 2025 18:24 — with GitHub Actions Inactive
Copy link
Contributor

@nathaliellenaa nathaliellenaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

jngz-es
jngz-es previously approved these changes May 21, 2025
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env May 21, 2025 20:51 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env May 21, 2025 20:51 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env May 21, 2025 20:51 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env May 21, 2025 20:51 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env May 21, 2025 20:54 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env May 21, 2025 20:54 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env May 21, 2025 20:54 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env May 21, 2025 20:54 — with GitHub Actions Inactive
Signed-off-by: Xun Zhang <xunzh@amazon.com>
ylwu-amzn
ylwu-amzn previously approved these changes May 21, 2025
@ylwu-amzn
Copy link
Collaborator

Signed-off-by: Xun Zhang <xunzh@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants