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

Preserve docstrings in auto-tracing #550

Merged
merged 2 commits into from
Oct 29, 2024
Merged

Conversation

alexmojaki
Copy link
Contributor

Closes #440

Copy link

cloudflare-workers-and-pages bot commented Oct 28, 2024

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6bb07cf
Status: ✅  Deploy successful!
Preview URL: https://0d7ad6bd.logfire-docs.pages.dev
Branch Preview URL: https://alex-fix-autotrace-docstring.logfire-docs.pages.dev

View logs

@alexmojaki alexmojaki enabled auto-merge (squash) October 29, 2024 09:50
@alexmojaki alexmojaki merged commit b05e9db into main Oct 29, 2024
16 checks passed
@alexmojaki alexmojaki deleted the alex/fix-autotrace-docstring branch October 29, 2024 09:53
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (eb5dd22) to head (6bb07cf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #550   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          132       132           
  Lines        10095     10100    +5     
  Branches      1367      1368    +1     
=========================================
+ Hits         10095     10100    +5     

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

new_body: list[ast.stmt] = []
if (
body
and isinstance(body[0], ast.Expr)
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose it is guaranteed that 0 must exist (even if it is just pass or ...)?

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'm pretty sure it is, but I started the condition with body and just in case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah right, at this point Rust's lack of "empty collection is not truthy" has eroded this from my mind 😂

@davidhewitt
Copy link
Contributor

All looks good to me, sorry for the late review 👍

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.

auto-tracing breaks numpy
2 participants