Skip to content

fix: Fix date/datetime_to_string handling of non-date/datetime inputs #55

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

Merged
merged 1 commit into from
Feb 4, 2020

Conversation

mkistler
Copy link
Contributor

This PR fixes the behavior of the recently added date/datetime_to_string methods to gracefully handle inputs that are not date or datetime. Most importantly, these methods should return None if the input is None. The new implementation simply returns the input argument whenever it is not of the expected type, which is consistent with the behavior of the other methods in the utils file.

@mkistler mkistler requested review from padamstx and ehdsouza January 31, 2020 23:43
@codecov
Copy link

codecov bot commented Jan 31, 2020

Codecov Report

Merging #55 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #55      +/-   ##
==========================================
+ Coverage   97.77%   97.78%   +0.01%     
==========================================
  Files          17       17              
  Lines         584      588       +4     
==========================================
+ Hits          571      575       +4     
  Misses         13       13
Impacted Files Coverage Δ
ibm_cloud_sdk_core/utils.py 99.12% <100%> (+0.03%) ⬆️
ibm_cloud_sdk_core/authenticators/authenticator.py 75% <0%> (ø) ⬆️
ibm_cloud_sdk_core/base_service.py 93.95% <0%> (ø) ⬆️
ibm_cloud_sdk_core/jwt_token_manager.py 100% <0%> (ø) ⬆️

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 26c478c...8251b82. Read the comment docs.

@mkistler mkistler force-pushed the fix-date-datetime-to-string branch from f31c666 to 8251b82 Compare February 1, 2020 12:54
Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@ehdsouza ehdsouza left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@mkistler mkistler merged commit 3fb168a into master Feb 4, 2020
@mkistler mkistler deleted the fix-date-datetime-to-string branch February 4, 2020 03:07
@ibm-devx-automation
Copy link

🎉 This PR is included in version 1.6.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants