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

[BUG] With_new_children not implemented for sample #2528

Merged
merged 3 commits into from
Jul 17, 2024
Merged

Conversation

colin-ho
Copy link
Contributor

@colin-ho colin-ho commented Jul 17, 2024

Addresses: #2510

Fixed:

import daft
x1 = daft.from_pydict({"foo": [1, 2], "bar": [1, 2]}) 
x2 = daft.from_pydict({"foo": [3, 4], "bar": [3, 4]}) 
x1 = x1.sample(0.5) 
x2 = x2.sample(0.5) 
xx = x1.concat(x2) 
xx = xx.select('foo') 
print(xx.collect())

@github-actions github-actions bot added the bug Something isn't working label Jul 17, 2024
@@ -199,7 +199,9 @@ impl LogicalPlan {
Self::Sink(Sink { sink_info, .. }) => Self::Sink(Sink::try_new(input.clone(), sink_info.clone()).unwrap()),
Self::MonotonicallyIncreasingId(MonotonicallyIncreasingId {column_name, .. }) => Self::MonotonicallyIncreasingId(MonotonicallyIncreasingId::new(input.clone(), Some(column_name))),
Self::Unpivot(Unpivot {ids, values, variable_name, value_name, output_schema, ..}) => Self::Unpivot(Unpivot { input: input.clone(), ids: ids.clone(), values: values.clone(), variable_name: variable_name.clone(), value_name: value_name.clone(), output_schema: output_schema.clone() }),
_ => panic!("Logical op {} has two inputs, but got one", self),
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 didn't catch this bug when I implemented Sample because of this catch all branch, so just gonna remove it in case someone else implements a new logical op and misses it too

@colin-ho colin-ho requested a review from jaychia July 17, 2024 17:30
Copy link
Contributor

@jaychia jaychia left a comment

Choose a reason for hiding this comment

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

LGTM, let's add a unit test as well inside test_concat.py?

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@346868e). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2528   +/-   ##
=======================================
  Coverage        ?   63.19%           
=======================================
  Files           ?      973           
  Lines           ?   108413           
  Branches        ?        0           
=======================================
  Hits            ?    68514           
  Misses          ?    39899           
  Partials        ?        0           
Files Coverage Δ
src/daft-plan/src/logical_plan.rs 68.39% <0.00%> (ø)

@colin-ho colin-ho merged commit a226d00 into main Jul 17, 2024
46 checks passed
@colin-ho colin-ho deleted the colin/sample-fix branch July 17, 2024 20:11
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.

2 participants