mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-05-05 01:10:27 +02:00
fix highspot
This commit is contained in:
parent
0497bfdf78
commit
75fa10cead
@ -193,12 +193,9 @@ class HighspotClient:
|
|||||||
"""
|
"""
|
||||||
params = {"right": "view"}
|
params = {"right": "view"}
|
||||||
response = self._make_request("GET", "spots", params=params)
|
response = self._make_request("GET", "spots", params=params)
|
||||||
logger.info(f"Received {response} spots")
|
found_spots = response.get("collection", [])
|
||||||
total_counts = response.get("counts_total")
|
logger.info(f"Received {len(found_spots)} spots")
|
||||||
# Fix comparison to handle None value
|
return found_spots
|
||||||
if total_counts is not None and total_counts > 0:
|
|
||||||
return response.get("collection", [])
|
|
||||||
return []
|
|
||||||
|
|
||||||
def get_spot(self, spot_id: str) -> Dict[str, Any]:
|
def get_spot(self, spot_id: str) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from typing import Any
|
from typing import Any
|
||||||
@ -447,7 +448,10 @@ class HighspotConnector(LoadConnector, PollConnector, SlimConnector):
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
spot_names: List[str] = []
|
spot_names: List[str] = []
|
||||||
connector = HighspotConnector(spot_names)
|
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)
|
connector.load_credentials(credentials=credentials)
|
||||||
for doc in connector.load_from_state():
|
for doc in connector.load_from_state():
|
||||||
print(doc)
|
print(doc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user