Skip to content

Commit d2e202a

Browse files
fix: lint
1 parent 9d939d8 commit d2e202a

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

test_unstructured/test_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ def it_sends_telemetry_when_opt_in_is_set(self, monkeypatch):
405405
utils.scarf_analytics()
406406
mock_get.assert_called_once()
407407
call_url = mock_get.call_args[0][0]
408-
assert "python-telemetry" in call_url and "version=" in call_url
408+
assert "python-telemetry" in call_url
409+
assert "version=" in call_url
409410

410411
def it_accepts_opt_in_value_1(self, monkeypatch):
411412
monkeypatch.setenv("UNSTRUCTURED_TELEMETRY_ENABLED", "1")

unstructured/logger.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ def detail(self, message, *args, **kws):
1717

1818

1919
# Telemetry is off by default. To opt in, set UNSTRUCTURED_TELEMETRY_ENABLED=true.
20-
# To opt out when enabled elsewhere, set SCARF_NO_ANALYTICS=true or DO_NOT_TRACK=true. See the README.
20+
# To opt out when enabled elsewhere, set SCARF_NO_ANALYTICS=true or DO_NOT_TRACK=true.
21+
# See the README.
2122
scarf_analytics()
2223

2324
# Add the custom log method to the logging.Logger class

unstructured/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,9 @@ def only(it: Iterable[Any]) -> Any:
270270

271271

272272
def scarf_analytics():
273-
"""Send a lightweight analytics ping. Off by default; set UNSTRUCTURED_TELEMETRY_ENABLED=true to opt in.
273+
"""Send a lightweight analytics ping. Off by default.
274274
275+
Set UNSTRUCTURED_TELEMETRY_ENABLED=true to opt in.
275276
Opt-out env vars (DO_NOT_TRACK, SCARF_NO_ANALYTICS) are always respected and take precedence.
276277
"""
277278
try:
@@ -282,8 +283,8 @@ def scarf_analytics():
282283

283284
python_version = ".".join(platform.python_version().split(".")[:2])
284285

285-
# Telemetry is off by default. Only send when user explicitly opts in via UNSTRUCTURED_TELEMETRY_ENABLED.
286-
# Opt-out env vars always take precedence.
286+
# Telemetry is off by default. Only send when user explicitly opts in via
287+
# UNSTRUCTURED_TELEMETRY_ENABLED. Opt-out env vars always take precedence.
287288
opt_out = os.getenv("SCARF_NO_ANALYTICS") == "true" or os.getenv("DO_NOT_TRACK") == "true"
288289
opt_in = os.getenv("UNSTRUCTURED_TELEMETRY_ENABLED", "").lower() in ("true", "1")
289290
if opt_out or not opt_in:

0 commit comments

Comments
 (0)