Skip to content

Commit

Permalink
chore(pyspark): lop off the fractional bits when constructing a perce…
Browse files Browse the repository at this point in the history
…ntage of rows to sample
  • Loading branch information
cpcloud committed Aug 28, 2024
1 parent 12c7d68 commit ce2d71f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ibis/backends/sql/compilers/pyspark.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def visit_Sample(
raise com.UnsupportedOperationError(
"PySpark backend does not support sampling with seed."
)
sample = sge.TableSample(percent=sge.convert(fraction * 100.0))
sample = sge.TableSample(percent=sge.convert(int(fraction * 100.0)))
return self._make_sample_backwards_compatible(sample=sample, parent=parent)

Check warning on line 338 in ibis/backends/sql/compilers/pyspark.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/sql/compilers/pyspark.py#L337-L338

Added lines #L337 - L338 were not covered by tests

def visit_WindowBoundary(self, op, *, value, preceding):
Expand Down

0 comments on commit ce2d71f

Please sign in to comment.