Skip to content

Conversation

@r3stl355
Copy link
Contributor

What changes are proposed in this pull request?

A simplified version of PR429 (to be closed/abandoned) using a doctest trick.

  • I had to make a small change to the macro code itself, changing crate:: todelta_kernel:: in the generated code.
  • Used existing developer-visibility feature instead of adding a new one as it seemed to fit the purpose
  • Added an extra command to justfile to run the new tests as part of existing testing process

How was this change tested?

All tests pass, including the newly added

@codecov
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 83.28%. Comparing base (f67c1cc) to head (b2b82b7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
derive-macros/src/lib.rs 66.66% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #514   +/-   ##
=======================================
  Coverage   83.28%   83.28%           
=======================================
  Files          93       93           
  Lines       22384    22384           
  Branches    22384    22384           
=======================================
  Hits        18642    18642           
  Misses       2786     2786           
  Partials      956      956           

☔ 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.

Copy link
Collaborator

@scovich scovich left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@zachschuermann zachschuermann left a comment

Choose a reason for hiding this comment

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

left a few questions!

@zachschuermann zachschuermann changed the title [chore] add derive macro tests [test] add derive macro tests Nov 25, 2024
@r3stl355
Copy link
Contributor Author

I added a second part that fixes an error in macro when fully-qulified multi-part types are used (forgot to push this earlier). Also added a passing docs test to verify, this test needs to be moved to normal test as part of #526

Copy link
Collaborator

@scovich scovich left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@zachschuermann zachschuermann changed the title [test] add derive macro tests test: add derive macro tests Mar 19, 2025
Copy link
Member

@zachschuermann zachschuermann left a comment

Choose a reason for hiding this comment

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

hey @r3stl355 are you able to pick this back up? just added a quick comment and would love to have this land :)

Signed-off-by: Niko <[email protected]>
@r3stl355
Copy link
Contributor Author

Made a bit of a mess and had to force-push, hope that's alright. Should be good now

Copy link
Collaborator

@scovich scovich left a comment

Choose a reason for hiding this comment

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

Very nice! Just one simplification left and should be ready for merge

@scovich
Copy link
Collaborator

scovich commented Apr 26, 2025

Hmm @zachschuermann it looks like something went wrong with the doctest+internal API combo? I thought we had set the CI to enable internal API while compiling doctests?

@r3stl355
Copy link
Contributor Author

Also, strangely, if I run just cargo test --doc on my machine without specifying any features the tests pass.

zachschuermann added a commit that referenced this pull request May 29, 2025
## What changes are proposed in this pull request?
With the introduction of `EvaluationHandler::create_one`, we can create
`EngineData` now. This PR adds a handy new procedural macro to implement
a new `IntoEngineData` trait which allows for
`self.into_engine_data(schema, &dyn Engine)` as long as all fields
implement `Into<Scalar>` (for now just support the simple case of
all-primitive fields)

This would typically be used in conjunction with `ToSchema` to provide
the schema for the output `EngineData`.

### Future work
Need to implement tests (make doctest on `IntoEngineData` trait actually
build): lump that in to #514
1. need to rename `crate::` to `delta_kernel::` in macros
2. need to make all the types we need conditionally pub (that is, if
`cfg(doctest)` then make stuff `pub`)
3. need to do an `extern crate self as delta_kernel`
4. and finally, make the doctest a `no_run` (building) doctest

## How was this change tested?
new UT
@r3stl355
Copy link
Contributor Author

r3stl355 commented Jun 5, 2025

@zachschuermann where does this one sit with all the recent changes, is it still relevant? I am leaving Databricks so need to keep myself occupied :)

@scovich
Copy link
Collaborator

scovich commented Jun 6, 2025

where does this one sit with all the recent changes, is it still relevant?

AFAIK, this is still important. In particular, it adds the ability to create working doctests for derive macros, which other recent PR would benefit from. I'll let @zachschuermann weigh in on whether/how this PR may need to expand tho.

@zachschuermann
Copy link
Member

Hi @r3stl355! Yes this is even more relevant after #830 landed :) - see the PR description over there for some overlapping derive macro test work that we need.

I opened another issue that basically just links to this PR and my PR: #991

I believe the remaining work would just be to (1) update this PR to work with the original stuff it intended to test and (2) add to this or open a new PR to expand the testing to my new #[derive(IntoEngineData)] macro!

@r3stl355
Copy link
Contributor Author

r3stl355 commented Jun 6, 2025

Cool, thanks @scovich & @zachschuermann, I'll see what I can come up with in the next few days

@r3stl355
Copy link
Contributor Author

Hi @zachschuermann, I updated the PR to work with latest changes. I suggest creating a different one for #[derive(IntoEngineData)] macro, otherwise I'll never get this one over the fence :)

@r3stl355
Copy link
Contributor Author

Hey, these failed checks look unrelated to my changes, is there something I need to do to pass them?

@zachschuermann
Copy link
Member

ah yep just need to rebase on current master and should be good to go! I just updated here via github UI and will take a look at this today :) thank you @r3stl355!

@zachschuermann zachschuermann merged commit 245c10c into delta-io:main Jul 22, 2025
20 of 21 checks passed
@zachschuermann
Copy link
Member

thank you @r3stl355!

@r3stl355
Copy link
Contributor Author

Thank you for merging @zachschuermann, I'll start looking into the other macro tests

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.

3 participants