Skip to content

Commit

Permalink
chore: Remove sdk info logs
Browse files Browse the repository at this point in the history
  • Loading branch information
bahlo committed Sep 25, 2024
1 parent 240b32b commit c33459c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
6 changes: 1 addition & 5 deletions src/axiom_py/annotations.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""This package provides annotation models and methods as well as an AnnotationsClient"""

import ujson
from logging import Logger
from requests import Session
from typing import List, Optional
from dataclasses import dataclass, asdict, field
Expand Down Expand Up @@ -55,9 +54,8 @@ class AnnotationsClient: # pylint: disable=R0903

session: Session

def __init__(self, session: Session, logger: Logger):
def __init__(self, session: Session):
self.session = session
self.logger = logger

def get(self, id: str) -> Annotation:
"""
Expand All @@ -79,7 +77,6 @@ def create(self, req: AnnotationCreateRequest) -> Annotation:
path = "/v2/annotations"
res = self.session.post(path, data=ujson.dumps(asdict(req)))
annotation = from_dict(Annotation, res.json())
self.logger.info(f"created new annotation: {annotation.id}")
return annotation

def list(
Expand Down Expand Up @@ -120,7 +117,6 @@ def update(self, id: str, req: AnnotationUpdateRequest) -> Annotation:
path = "/v2/annotations/%s" % id
res = self.session.put(path, data=ujson.dumps(asdict(req)))
annotation = from_dict(Annotation, res.json())
self.logger.info(f"updated annotation({annotation.id})")
return annotation

def delete(self, id: str):
Expand Down
9 changes: 2 additions & 7 deletions src/axiom_py/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from enum import Enum
from humps import decamelize
from typing import Optional, List, Dict, Callable
from logging import getLogger
from dataclasses import dataclass, field, asdict
from datetime import datetime
from requests_toolbelt.sessions import BaseUrlSession
Expand Down Expand Up @@ -147,7 +146,6 @@ def __init__(
if url_base is None:
url_base = AXIOM_URL

self.logger = getLogger()
# set exponential retries
retries = Retry(
total=3, backoff_factor=2, status_forcelist=[500, 502, 503, 504]
Expand All @@ -172,12 +170,11 @@ def __init__(
# if there is an organization id passed,
# set it in the header
if org_id:
self.logger.info("found organization id: %s" % org_id)
self.session.headers.update({"X-Axiom-Org-Id": org_id})

self.datasets = DatasetsClient(self.session, self.logger)
self.datasets = DatasetsClient(self.session)
self.users = UsersClient(self.session, is_personal_token(token))
self.annotations = AnnotationsClient(self.session, self.logger)
self.annotations = AnnotationsClient(self.session)

# wrap shutdown hook in a lambda passing in self as a ref
atexit.register(self.shutdown_hook)
Expand Down Expand Up @@ -264,7 +261,6 @@ def query_legacy(
result = from_dict(QueryLegacyResult, res.json())
self.logger.debug(f"query result: {result}")
query_id = res.headers.get("X-Axiom-History-Query-Id")
self.logger.info(f"received query result with query_id: {query_id}")
result.savedQueryID = query_id
return result

Expand Down Expand Up @@ -297,7 +293,6 @@ def query(
result = from_dict(QueryResult, res.json())
self.logger.debug(f"apl query result: {result}")
query_id = res.headers.get("X-Axiom-History-Query-Id")
self.logger.info(f"received query result with query_id: {query_id}")
result.savedQueryID = query_id
return result

Expand Down
8 changes: 1 addition & 7 deletions src/axiom_py/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""

import ujson
from logging import Logger
from requests import Session
from typing import List
from dataclasses import dataclass, asdict, field
Expand Down Expand Up @@ -52,9 +51,8 @@ class DatasetsClient: # pylint: disable=R0903

session: Session

def __init__(self, session: Session, logger: Logger):
def __init__(self, session: Session):
self.session = session
self.logger = logger

def get(self, id: str) -> Dataset:
"""
Expand Down Expand Up @@ -86,7 +84,6 @@ def create(self, name: str, description: str = "") -> Dataset:
),
)
ds = from_dict(Dataset, res.json())
self.logger.info(f"created new dataset: {ds.name}")
return ds

def get_list(self) -> List[Dataset]:
Expand Down Expand Up @@ -123,9 +120,6 @@ def update(self, id: str, new_description: str) -> Dataset:
),
)
ds = from_dict(Dataset, res.json())
self.logger.info(
f"updated dataset({ds.name}) with new desc: {ds.description}"
)
return ds

def delete(self, id: str):
Expand Down

0 comments on commit c33459c

Please sign in to comment.