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

implement and test search function #24

Merged
merged 5 commits into from
Feb 5, 2025
Merged

Conversation

jeanmi151
Copy link
Contributor

No description provided.

@jeanmi151 jeanmi151 requested a review from mki-c2c January 31, 2025 09:10
Copy link
Contributor

@mki-c2c mki-c2c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, this is great to have such a simple implementation of the search function

@@ -100,6 +100,14 @@ def get_sources() -> list[dict[str, str]]:
def get_destinations() -> list[dict[str, str]]:
return config.get_destinations()

@app.post("/search/{src_name}")
def post_search(src_name: str, data: Dict[str, Any]) :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the signature should be:

from fastapi import Body
@app.post("/search/{src_name}")
def post_search(
    src_name: str,
    data: importance: Annotated[dict[str, Any], Body()],
):

Have not tried it, please let me know if this works or if you run into trouble

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the key word "importance" doesn't exist
but it works that way :
def post_search(src_name: str, data: Annotated[dict[str, Any], Body()] ):

backend/tests/test_config.yaml Outdated Show resolved Hide resolved
backend/maelstro/main.py Outdated Show resolved Hide resolved
backend/maelstro/main.py Outdated Show resolved Hide resolved
@mki-c2c mki-c2c force-pushed the backend_search_distant_gn branch from 8065639 to 752fe8b Compare February 4, 2025 07:24
@mki-c2c mki-c2c force-pushed the backend_search_distant_gn branch from 7d76683 to 752fe8b Compare February 5, 2025 08:30
@mki-c2c mki-c2c merged commit 1ff30b3 into main Feb 5, 2025
6 checks passed
@arnaud-morvan arnaud-morvan deleted the backend_search_distant_gn branch February 12, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants