Conversation
|
Looks like the CI environment has been updated which caused the following error: opencensus/stats/exporters/stackdriver_exporter.py:23:42: W606 'async' and 'await' are reserved keywords starting with Python 3.7 I'll try to fix them. |
|
I've submitted a separate PR #362 to unblock the build. |
| return os.path.join("custom.googleapis.com", "opencensus", view_name) | ||
| return os.path.join(metric_prefix, view_name) | ||
| metric_prefix = metric_prefix or "custom.googleapis.com/opencensus" | ||
| return os.path.join(metric_prefix, view_name).replace('\\', '/') |
There was a problem hiding this comment.
using os.path.join here may not be ideal. Perhaps use join with the specified separator instead?
There was a problem hiding this comment.
os.path.join will take care of duplicated/trailing separators, for example, join("a/b/", "c") will yield the same result as join("a/b", "c"). It'll be better to reuse such logic from os.path.join than manually doing path normalization and joining.
|
Thanks @bogdandrutu and @SergeyKanzhelev. |
The current implementation fails the unit test on Windows, due to the backslashes introduced by os.path.join.
The fix is to replace backslash with forward slash before return.