Skip to content

Preserve docstrings in auto-tracing - #550

Merged
alexmojaki merged 2 commits into
mainfrom
alex/fix-autotrace-docstring
Oct 29, 2024
Merged

alexmojaki merged 2 commits into
mainfrom
alex/fix-autotrace-docstring

Conversation

@alexmojaki

Copy link
Copy Markdown
Contributor

Closes #440

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 28, 2024 •

Copy link
Copy Markdown

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
@alexmojaki
alexmojaki deleted the alex/fix-autotrace-docstring branch October 29, 2024 09:53
@codecov

codecov Bot commented Oct 29, 2024

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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