Skip to content

Commit af4cf1f

Browse files
committed
style: fix error [FLY002] - Consider f"{start}-{end}" instead of string join.
Used Ruff (vscode and pre-commit) to: - Black-compatible code formatting. - fix all auto-fixable violations. - isort-compatible import sorting. - flake8-simplify manual fixes. Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
1 parent 03fcbd2 commit af4cf1f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • src/instana/instrumentation/google/cloud

src/instana/instrumentation/google/cloud/storage.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _collect_attributes(
2727
:param: dict
2828
:return: dict or None
2929
"""
30-
method, path = api_request.get("method", None), api_request.get("path", None)
30+
method, path = api_request.get("method"), api_request.get("path")
3131

3232
if method not in _storage_api:
3333
return
@@ -106,16 +106,16 @@ def download_with_instana(
106106
span.set_attribute("gcs.bucket", instance.bucket.name)
107107
span.set_attribute("gcs.object", instance.name)
108108

109-
start = len(args) > 4 and args[4] or kwargs.get("start", None)
109+
start = len(args) > 4 and args[4] or kwargs.get("start")
110110
if start is None:
111111
start = ""
112112

113-
end = len(args) > 5 and args[5] or kwargs.get("end", None)
113+
end = len(args) > 5 and args[5] or kwargs.get("end")
114114
if end is None:
115115
end = ""
116116

117117
if start != "" or end != "":
118-
span.set_attribute("gcs.range", "-".join((start, end)))
118+
span.set_attribute("gcs.range", f"{start}-{end}")
119119

120120
try:
121121
kv = wrapped(*args, **kwargs)

0 commit comments

Comments
 (0)