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

Feat refactor shape builder #491

Merged
merged 4 commits into from
Jan 13, 2025
Merged

Feat refactor shape builder #491

merged 4 commits into from
Jan 13, 2025

Conversation

jpschorr
Copy link
Contributor

@jpschorr jpschorr commented Aug 28, 2024

I had issues practically using Shapes with Ids in an external project. I began fixing one thing, and ended up with this refactor.

Esentially, this removes usages of Arcs and allows control of the ID generation by using a builder that is threaded through type creation. While this is slightly less ergonomic, it allows serialization/deserialization, test cases, etc.

In addition to these changes, I also think that we will need to add IDs to, for example, undefined and dynamic types, not just static in the future.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 84.70588% with 65 lines in your changes missing coverage. Please review.

Project coverage is 81.49%. Comparing base (1b19d11) to head (eb7233c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
partiql-types/src/lib.rs 67.94% 50 Missing ⚠️
partiql-logical-planner/src/typer.rs 87.50% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #491      +/-   ##
==========================================
+ Coverage   81.46%   81.49%   +0.02%     
==========================================
  Files          89       89              
  Lines       19388    19547     +159     
  Branches    19388    19547     +159     
==========================================
+ Hits        15795    15929     +134     
- Misses       3175     3200      +25     
  Partials      418      418              

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

Copy link

github-actions bot commented Aug 28, 2024

Conformance comparison report

Base (1b19d11) 9746ab6 +/-
% Passing 86.90% 86.90% 0.00%
✅ Passing 5587 5587 0
❌ Failing 842 842 0
🔶 Ignored 0 0 0
Total Tests 6429 6429 0

Number passing in both: 5587

Number failing in both: 842

Number passing in Base (1b19d11) but now fail: 0

Number failing in Base (1b19d11) but now pass: 0

@jpschorr jpschorr force-pushed the feat-refactor-shape-builder branch from 0607b05 to 07a5c11 Compare August 28, 2024 00:48
@jpschorr jpschorr force-pushed the feat-refactor-shape-builder branch from 07a5c11 to 2ddd741 Compare January 10, 2025 20:35
@jpschorr jpschorr changed the base branch from main to feat-conformance-test-names January 10, 2025 20:36
@jpschorr jpschorr requested review from alancai98 and am357 January 10, 2025 20:37
@jpschorr jpschorr marked this pull request as ready for review January 10, 2025 20:37
Base automatically changed from feat-conformance-test-names to main January 10, 2025 21:54
@jpschorr jpschorr force-pushed the feat-refactor-shape-builder branch from 2ddd741 to 3e2b6c1 Compare January 10, 2025 22:39
@@ -40,7 +40,9 @@ impl BindEvalExpr for EvalStringFn {
F: Fn(&Box<String>) -> R + 'static,
R: Into<Value> + 'static,
{
UnaryValueExpr::create_typed::<{ STRICT }, _>([type_string!()], args, move |value| {
// use DummyShapeBuilder, as we don't care about shape Ids for evaluation dispatch
let mut bld = DummyShapeBuilder::default();
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the usage is going beyond just tests perhaps it's more appropriate to rename the DummyShapeBuilder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably a good idea. Any suggestions?

Copy link
Contributor

@am357 am357 Jan 13, 2025

Choose a reason for hiding this comment

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

Not sure how good these are, just putting them out there :)
PartiqlNoIdShapeBuilder, NoIdShapeBuilder, StaticIdShapeBuilder

@@ -5,7 +5,7 @@ use crate::eval::eval_expr_wrapper::{
use crate::eval::expr::{BindError, BindEvalExpr, EvalExpr};
use crate::eval::EvalContext;

use partiql_types::{PartiqlShapeBuilder, StructType};
use partiql_types::{DummyShapeBuilder, PartiqlShapeBuilder, StructType};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
use partiql_types::{DummyShapeBuilder, PartiqlShapeBuilder, StructType};
use partiql_types::DummyShapeBuilder;

Based on clippy, it looks like PartiqlShapeBuilder and StructType are unused.

@jpschorr jpschorr force-pushed the feat-refactor-shape-builder branch from a915a13 to eb7233c Compare January 13, 2025 22:04
@jpschorr jpschorr merged commit 76764b7 into main Jan 13, 2025
19 checks passed
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