Skip to content

Conversation

@pratduv
Copy link
Contributor

@pratduv pratduv commented Aug 7, 2025

TL;DR: rn we have logic for flush(), update_trace/step_streaming() etc that calls a sync/async function in core_api_client.py that has the same logic duplicated across the sync/async functions
Depending on whether it's a sync or async function, we then call galileo-core api_client.py request() or arequest() .. but both eventually use the same ApiClient.make_request call
I think this balloons that file up for no reason (unless I'm missing something important) and we should have async_run used instead at the logger.py level.

@codecov
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.71%. Comparing base (8d82fd0) to head (436c772).

Files with missing lines Patch % Lines
src/galileo/logger/logger.py 83.33% 2 Missing ⚠️
src/galileo/decorator.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #263      +/-   ##
==========================================
+ Coverage   80.63%   80.71%   +0.08%     
==========================================
  Files          46       46              
  Lines        3511     3495      -16     
==========================================
- Hits         2831     2821      -10     
+ Misses        680      674       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pratduv pratduv force-pushed the prat/fix branch 2 times, most recently from 436c772 to 6f29896 Compare August 7, 2025 17:58
RequestMethod.POST, endpoint=Routes.traces.format(project_id=self.project_id), json=json
)

async def ingest_spans(self, spans_ingest_request: SpansIngestRequest) -> dict[str, str]:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to do what I did with ingest_traces to all other functions in this file. Do we really need both _make_request and _make_async_requestwhen under the hood request callsasync_runin the end (viagalileo-core`? We have a lot of logic duplication in this file

name=name, previous_session_id=previous_session_id, external_id=external_id
)

async def async_start_session(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ignore this change for now

@pratduv pratduv force-pushed the prat/fix branch 2 times, most recently from 8b14cef to bf88d78 Compare August 7, 2025 18:45
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