Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve ruff lint errors #171

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pebblo/app/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def load_config(path) -> Config:
config_dict = parsed_config.dict()
return config_dict
except IOError as err:
print(f"no credentials file found at {con_file}")
print(f"no credentials file found at {con_file}. Error : {err}")
return conf_obj.dict()

except Exception as err:
Expand Down
1 change: 0 additions & 1 deletion pebblo/app/daemon.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from contextlib import redirect_stderr, redirect_stdout
import uvicorn

from io import StringIO
from tqdm import tqdm
Expand Down
1 change: 0 additions & 1 deletion pebblo/app/enums/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
These are all enums related to Inspector.
"""
from enum import Enum
import os
from pebblo.app.daemon import config_details


Expand Down
2 changes: 1 addition & 1 deletion pebblo/app/service/discovery_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def process_request(self):
f"/{CacheDir.metadata_file_path.value}")
self._write_file_content_to_path(ai_apps.dict(), file_path)

logger.debug(f"AiApp discovery request completed successfully")
logger.debug("AiApp discovery request completed successfully")
return {"message": "App Discover Request Processed Successfully"}
except ValidationError as ex:
logger.error(f"Error in process_request. Error:{ex}")
Expand Down
2 changes: 0 additions & 2 deletions pebblo/app/service/service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import logging
from datetime import datetime

from fastapi import HTTPException
from pydantic import ValidationError

Expand Down
2 changes: 1 addition & 1 deletion pebblo/reports/reports.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Import HTML to PDF generator function

from pebblo.reports.html_to_pdf_generator.report_generator import convertHtmlToPdf;
from pebblo.reports.html_to_pdf_generator.report_generator import convertHtmlToPdf
from pebblo.reports.enums.report_libraries import ReportLibraries, template_renderer_mapping
from pebblo.reports.libs.logger import logger
import os
Expand Down
6 changes: 3 additions & 3 deletions samples/langchain/acme-corp-rag/acme_corp_rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ def __init__(self, file_path: str):

# Load documents

print(f"Loading RAG documents ...")
print("Loading RAG documents ...")
self.loader = CSVLoader(self.file_path)
self.documents = self.loader.load()
self.filtered_docs = filter_complex_metadata(self.documents)
print(f"Loaded {len(self.documents)} documents ...\n")

# Load documents into VectorDB

print(f"Hydrating Vector DB ...")
print("Hydrating Vector DB ...")
self.vectordb = self.embeddings(self.filtered_docs)
print(f"Finished hydrating Vector DB ...\n")
print("Finished hydrating Vector DB ...\n")

# Prepare retriever QA chain

Expand Down
6 changes: 3 additions & 3 deletions samples/langchain/acme-corp-rag/acme_corp_rag_pebblo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, file_path: str):

# Load documents

print(f"Loading RAG documents ...")
print("Loading RAG documents ...")
self.loader = PebbloSafeLoader(
CSVLoader(self.file_path),
name="acme-corp-rag-1", # App name (Mandatory)
Expand All @@ -35,9 +35,9 @@ def __init__(self, file_path: str):

# Load documents into VectorDB

print(f"Hydrating Vector DB ...")
print("Hydrating Vector DB ...")
self.vectordb = self.embeddings(self.filtered_docs)
print(f"Finished hydrating Vector DB ...\n")
print("Finished hydrating Vector DB ...\n")

# Prepare retriever QA chain

Expand Down
4 changes: 2 additions & 2 deletions tests/app/service/test_loader_doc.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import datetime
import pytest
from unittest.mock import MagicMock, patch
from pebblo.app.models.models import Summary, DataSource
from pebblo.app.service.doc_helper import LoaderHelper, AiDataModel
from pebblo.app.models.models import DataSource
from pebblo.app.service.doc_helper import LoaderHelper

data = {
"name": "UnitTestApp",
Expand Down