From 75fa10cead2e5fca5b74f84da9a1b99d3257de1c Mon Sep 17 00:00:00 2001 From: Weves Date: Thu, 1 May 2025 13:46:17 -0700 Subject: [PATCH] fix highspot --- backend/onyx/connectors/highspot/client.py | 9 +++------ backend/onyx/connectors/highspot/connector.py | 6 +++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/backend/onyx/connectors/highspot/client.py b/backend/onyx/connectors/highspot/client.py index 3a3fc10b2..2df902ceb 100644 --- a/backend/onyx/connectors/highspot/client.py +++ b/backend/onyx/connectors/highspot/client.py @@ -193,12 +193,9 @@ class HighspotClient: """ params = {"right": "view"} response = self._make_request("GET", "spots", params=params) - logger.info(f"Received {response} spots") - total_counts = response.get("counts_total") - # Fix comparison to handle None value - if total_counts is not None and total_counts > 0: - return response.get("collection", []) - return [] + found_spots = response.get("collection", []) + logger.info(f"Received {len(found_spots)} spots") + return found_spots def get_spot(self, spot_id: str) -> Dict[str, Any]: """ diff --git a/backend/onyx/connectors/highspot/connector.py b/backend/onyx/connectors/highspot/connector.py index e7f9684e2..c9eaf18cc 100644 --- a/backend/onyx/connectors/highspot/connector.py +++ b/backend/onyx/connectors/highspot/connector.py @@ -1,3 +1,4 @@ +import os from datetime import datetime from io import BytesIO from typing import Any @@ -447,7 +448,10 @@ class HighspotConnector(LoadConnector, PollConnector, SlimConnector): if __name__ == "__main__": spot_names: List[str] = [] connector = HighspotConnector(spot_names) - credentials = {"highspot_key": "", "highspot_secret": ""} + credentials = { + "highspot_key": os.environ.get("HIGHSPOT_KEY"), + "highspot_secret": os.environ.get("HIGHSPOT_SECRET"), + } connector.load_credentials(credentials=credentials) for doc in connector.load_from_state(): print(doc)