Repository navigation
SSW-3012: Use ACCESS_TOKEN in ConsDbClient by default. - #199
Conversation
sebastian-aranda
left a comment
There was a problem hiding this comment.
Looks good to me 👍 .
mypy-coverage report✅ All 845 definitions are fully annotated.
Summary
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #199 +/- ##
==========================================
+ Coverage 24.37% 24.60% +0.22%
==========================================
Files 39 39
Lines 7228 7238 +10
==========================================
+ Hits 1762 1781 +19
+ Misses 5466 5457 -9
🚀 New features to boost your workflow:
|
mfisherlevine
left a comment
There was a problem hiding this comment.
I wrote these comments ages ago, but it seems I forget to submit them, sorry about that!
| self.read_timeout = read_timeout | ||
|
|
||
| if token is None: | ||
| token = os.environ.get("ACCESS_TOKEN") or None |
There was a problem hiding this comment.
I think that's more usually expressed as .get("ACCESS_TOKEN", None) but this is fine too.
There was a problem hiding this comment.
I think this is to prevent empty strings in ACCESS_TOKEN, i.e. if .get("ACCESS_TOKEN", None) when ACCESS_TOKEN="" then the sentence returns an empty string instead of None.
| if token is None: | ||
| token = os.environ.get("ACCESS_TOKEN") or None | ||
| if token is not None: | ||
| if token.startswith("gt-"): |
There was a problem hiding this comment.
Assuming this is always going to be correct this is fine. I wonder what would cause this to be wrong, or why this is always the case. You can probably just ignore my ponderings though.
If a valid token is contained in the ACCESS_TOKEN environment variable, it will be sent by default by the ConsDbClient.