Skip to content

Commit e95700e

Browse files
committed
Fix bug in telemetry folder creation
Signed-off-by: Willem Pienaar <git@willem.co>
1 parent 6304284 commit e95700e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

sdk/python/feast/telemetry.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import uuid
1818
from datetime import datetime
1919
from os.path import expanduser, join
20+
from pathlib import Path
2021

2122
import requests
2223

@@ -29,7 +30,9 @@
2930

3031
class Telemetry:
3132
def __init__(self):
32-
telemetry_filepath = join(expanduser("~"), ".feast", "telemetry")
33+
feast_home_dir = join(expanduser("~"), ".feast")
34+
Path(feast_home_dir).mkdir(exist_ok=True)
35+
telemetry_filepath = join(feast_home_dir, "telemetry")
3336
self._telemetry_enabled = (
3437
os.getenv("FEAST_TELEMETRY", default="True") == "True"
3538
) # written this way to turn the env var string into a boolean
@@ -43,6 +46,7 @@ def __init__(self):
4346
self._telemetry_id = f.read()
4447
else:
4548
self._telemetry_id = str(uuid.uuid4())
49+
4650
with open(telemetry_filepath, "w") as f:
4751
f.write(self._telemetry_id)
4852
print(

0 commit comments

Comments
 (0)