awslabs / sagemaker-debugger

Amazon SageMaker Debugger provides functionality to save tensors during training of machine learning jobs and analyze those tensors
Apache License 2.0
161 stars 83 forks source link

[DO Not Merge] Avoid using 'default' keyword while invoking 'get' method #473

Open leleamol opened 3 years ago

leleamol commented 3 years ago

Description of changes:

As mentioned in the issue #418 customers may see the error because of having 'default' keyword in the 'get()' call.

This change avoid using this keyword argument in 'get()' call to avoid potential issues.

As mentioned in the issue, the tokenizer in transformers package is modifying the data type of os.environ from os.Environ to 'dict'. The change in this PR is for protecting smdebug from such changes while keeping the behavior same.

Style and formatting:

I have run pre-commit install to ensure that auto-formatting happens with every commit.

Issue number, if available

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

codecov-io commented 3 years ago

Codecov Report

Merging #473 (f9b09ae) into master (1aac94b) will decrease coverage by 0.44%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #473      +/-   ##
==========================================
- Coverage   65.53%   65.09%   -0.45%     
==========================================
  Files         173      163      -10     
  Lines       13280    12934     -346     
==========================================
- Hits         8703     8419     -284     
+ Misses       4577     4515      -62     
Impacted Files Coverage Δ
smdebug/core/logger.py 70.83% <100.00%> (ø)
smdebug/core/modes.py 55.00% <0.00%> (-20.00%) :arrow_down:
smdebug/xgboost/singleton_utils.py 0.00% <0.00%> (-20.00%) :arrow_down:
smdebug/trials/profiler_trial.py 24.61% <0.00%> (-18.47%) :arrow_down:
smdebug/mxnet/collection.py 73.33% <0.00%> (-16.67%) :arrow_down:
smdebug/exceptions.py 65.47% <0.00%> (-15.48%) :arrow_down:
smdebug/core/reader.py 85.18% <0.00%> (-7.41%) :arrow_down:
smdebug/tensorflow/callable_cache.py 78.26% <0.00%> (-6.53%) :arrow_down:
smdebug/core/locations.py 86.11% <0.00%> (-5.56%) :arrow_down:
smdebug/core/tensor.py 79.03% <0.00%> (-2.02%) :arrow_down:
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1aac94b...f9b09ae. Read the comment docs.

NihalHarish commented 3 years ago

Let's not merge this. If this is the correct way to handle env variables then be it.