File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717import uuid
1818from datetime import datetime
1919from os .path import expanduser , join
20+ from pathlib import Path
2021
2122import requests
2223
2930
3031class 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 (
You can’t perform that action at this time.
0 commit comments