Skip to content

Commit

Permalink
Solved import & module errors
Browse files Browse the repository at this point in the history
  • Loading branch information
subratamondal1 committed Feb 8, 2024
1 parent 2330c4f commit 9d87096
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 12 deletions.
Empty file removed __init__.py
Empty file.
150 changes: 149 additions & 1 deletion poetry.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ python-dotenv = "^1.0.1"
fastapi = "^0.109.2"
uvicorn = "^0.27.0.post1"
jinja2 = "^3.1.3"
requests = "^2.31.0"


[build-system]
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ pytest-cov == 4.1.0
pylint == 3.0.3
pyarrow == 15.0.0
python-dotenv == 1.0.1
jinja2 == 3.1.3
jinja2 == 3.1.3
requests == 2.31.0
11 changes: 5 additions & 6 deletions src/app/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Entry Point for the FastAPI App"""

from pathlib import Path
from typing import List, Optional
from fastapi import FastAPI, HTTPException, Query, Request
Expand All @@ -12,14 +13,11 @@

app = FastAPI()


@app.get(path="/")
def homepage(request:Request, response_model=responses.HTMLResponse):
def homepage(request: Request):
return TEMPLATES.TemplateResponse(
"home.html",
{
"request":request,
"name": "Subrata Mondal"
}
"home.html", {"request": request, "name": "Subrata Mondal"}
)


Expand Down Expand Up @@ -62,6 +60,7 @@ def get_recommendations(keywords: Optional[List[str]] = Query(max_length=16)):
content=recommendations, status_code=status.HTTP_200_OK
)


# if __name__=="__main__":
# import uvicorn
# uvicorn.run(app, port=8080, host="0.0.0.0")
2 changes: 1 addition & 1 deletion src/logics/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Optional, List
import argparse
import pandas as pd
from recommender import Recommender
from .recommender import Recommender


class BaseUser(ABC):
Expand Down
5 changes: 2 additions & 3 deletions tests/test_data_extraction.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import pytest
from datetime import datetime, timedelta
import src.logics.data_extraction as data_extraction

import pytest
import pandas as pd
from src.logics import data_extraction


@pytest.fixture
Expand Down

0 comments on commit 9d87096

Please sign in to comment.