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

Refactor Log CRUD methods in client #16565

Merged
merged 4 commits into from
Jan 1, 2025
Merged

Refactor Log CRUD methods in client #16565

merged 4 commits into from
Jan 1, 2025

Conversation

aaazzam
Copy link
Collaborator

@aaazzam aaazzam commented Jan 1, 2025

Related to #16472, this PR continues the optimization pattern established for Artifacts. Like the previous PRs, it:

  • Refactors the client's Log CR methods into a standalone module
  • Uses ForwardRefs for heavy imports, moving them into the call itself

@github-actions github-actions bot added the bug Something isn't working label Jan 1, 2025
Copy link

codspeed-hq bot commented Jan 1, 2025

CodSpeed Performance Report

Merging #16565 will not alter performance

Comparing logs-client (7089adc) with main (82f35ec)

Summary

✅ 3 untouched benchmarks

Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

Also a great way to get parity between the sync and async clients!

log.model_dump(mode="json") if isinstance(log, LogCreate) else log
for log in logs
]
self._client.post("/logs/", json=serialized_logs)
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to use self.request here and in the other methods?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

woof, yep!

@aaazzam aaazzam merged commit 670fb80 into main Jan 1, 2025
38 checks passed
@aaazzam aaazzam deleted the logs-client branch January 1, 2025 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants