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

Faststream poc #399

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open

Faststream poc #399

wants to merge 26 commits into from

Conversation

TrangPham
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Aug 16, 2024

❌ 12 Tests Failed:

Tests completed Failed Passed Skipped
481 12 469 2
View the top 3 failed tests by shortest run time
tests.agent.test_agent�test_gx_agent_sends_request_to_create_scheduled_job
Stack Traces | 0.005s run time
No failure message available
tests.agent.test_agent�test_gx_agent_updates_cloud_on_job_status
Stack Traces | 0.005s run time
No failure message available
tests.agent.test_agent�test_gx_agent_run_handles_client_authentication_error_on_init
Stack Traces | 0.006s run time
No failure message available

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

@TrangPham TrangPham marked this pull request as ready for review August 19, 2024 17:54
@TrangPham TrangPham requested a review from wookasz August 19, 2024 17:54
@TrangPham TrangPham changed the title Fastapi poc Faststream Aug 20, 2024
@TrangPham TrangPham changed the title Faststream Faststream poc Aug 20, 2024
Comment on lines +124 to +126
processed_successfully=mock.Mock(),
processed_with_failures=mock.Mock(),
redeliver_message=mock.Mock(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are the values here set to mock.Mock()?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@@ -1 +1 @@
3.10.14
3.11.9
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it best to bring this change in separately?

Comment on lines +114 to +115
# Use Retries = 10, --workers 1
# Data Context as a Dependency
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what these comments mean, should they stay?

Suggested change
# Use Retries = 10, --workers 1
# Data Context as a Dependency

@@ -10,9 +10,16 @@
from functools import partial
from importlib.metadata import version as metadata_version
from typing import TYPE_CHECKING, Any, Callable, Dict, Final, Literal
from unittest import mock
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't have any unittest imports in production

Copy link
Contributor

@rreinoldsc rreinoldsc left a comment

Choose a reason for hiding this comment

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

unittest dep should not be in application code

try:
organization_id = gx_agent.get_organization_id(event_context)
result = gx_agent._handle_event(event_context)
except Exception as e:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be a more narrow catch?

if result.job_duration
else None,
"job_duration": (
result.job_duration.total_seconds() if result.job_duration else None
Copy link
Contributor

@rreinoldsc rreinoldsc Aug 20, 2024

Choose a reason for hiding this comment

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

This seems to be out of scope of your changes, but a job_duration of 0 seconds would result in None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants