chore(recommendations): Updated python modules for trainer. Added script to save features from feedback sessions into ml database.
This commit is contained in:
parent
a1d6c53aef
commit
0fb02512ad
3 changed files with 8 additions and 5 deletions
|
|
@ -30,9 +30,10 @@ dbname = config('pg_dbname_ml')
|
|||
password = config('pg_password_ml')
|
||||
tracking_uri = f"postgresql+psycopg2://{user}:{password}@{host}:{port}/{dbname}"
|
||||
|
||||
|
||||
# 1702296756
|
||||
def get_today_feedback():
|
||||
query = "SELECT project_id, session_id, user_id as viewer_id, payload FROM recommendation_feedback"
|
||||
current_datetime = int((datetime.now()-timedelta(seconds=execute_interval)).timestamp())
|
||||
query = f"SELECT project_id, session_id, user_id as viewer_id, payload FROM recommendation_feedback WHERE insertion_time >= {current_datetime}"
|
||||
|
||||
connection_handler = ConnectionHandler(tracking_uri) # Connection to mlflow's database
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
argcomplete==3.1.2
|
||||
apache-airflow==2.7.2
|
||||
airflow-code-editor==7.4.1
|
||||
argcomplete==3.2.1
|
||||
apache-airflow==2.7.3
|
||||
airflow-code-editor==7.5.0
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ class ClickHouseClient:
|
|||
self.__client = clickhouse_driver.Client(host=config("ch_host"),
|
||||
database="default",
|
||||
port=config("ch_port", cast=int),
|
||||
user=config("ch_user", cast=str),
|
||||
password=config("ch_password", cast=str),
|
||||
settings=settings) \
|
||||
if self.__client is None else self.__client
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue