sagemaker-python-sdk
sagemaker-python-sdk copied to clipboard
fix: correct response in metrics manager
The SageMaker metrics api's response returns a list of errors(if there were any). This patch fixes the error code parsing.
*Issue #, if available: #4482
*Description of changes:
- The API Shape for BatchPutMetrics's response is https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker-metrics/client/batch_put_metrics.html. It uses Code rather than Message as the key
Testing done:
import sagemaker
import boto3
from sagemaker.experiments import run
from sagemaker.session import Session
my_run = run.Run(
experiment_name="experimentfoo",
run_name="runfoo",
tags={"tagkey": "tagvalue"},
sagemaker_session=Session(),
)
steps = 100
lr = 0.0001
with my_run as my_run_ :
for step in range(steps):
my_run_.log_metric(name="Learning Rate", value=lr, step=step)
Merge Checklist
Put an x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.
General
- [x] I have read the CONTRIBUTING doc
- [x] I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
- [x] I used the commit message format described in CONTRIBUTING
- [x] I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
- [x] I have updated any necessary documentation, including READMEs and API docs (if appropriate)
Tests
- [n/a] I have added tests that prove my fix is effective or that my feature works (if appropriate)
- [n/a] I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes
- [x] I have checked that my tests are not configured for a specific region or account (if appropriate)
- [x] I have used
unique_name_from_base
to create resource names in integ tests (if appropriate)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Codecov Report
Attention: Patch coverage is 0%
with 1 lines
in your changes are missing coverage. Please review.
Project coverage is 87.44%. Comparing base (
abe1674
) to head (b4070e8
). Report is 1 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
src/sagemaker/experiments/_metrics.py | 0.00% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #4563 +/- ##
==========================================
- Coverage 87.44% 87.44% -0.01%
==========================================
Files 389 389
Lines 36889 36889
==========================================
- Hits 32258 32257 -1
- Misses 4631 4632 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
AWS CodeBuild CI Report
- CodeBuild project: sagemaker-python-sdk-pr
- Commit ID: b4070e850a9e27be2ca33ace98c6070db3d4cfc8
- Result: SUCCEEDED
- Build Logs (available for 30 days)
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository