Skip to content

Commit

Permalink
random sample fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollman committed Nov 6, 2024
1 parent b422f0b commit ccf967c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions materializationengine/blueprints/client/api2.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,11 @@ def execute_materialized_query(
.filter(MaterializedMetadata.table_name == user_data["table"])
.scalar()
)
if random_sample >= mat_row_count:
random_sample = None
else:
random_sample = (100.0 * random_sample) / mat_row_count
if random_sample:
if random_sample >= mat_row_count:
random_sample = None
else:
random_sample = (100.0 * random_sample) / mat_row_count

if mat_row_count:
# setup a query manager
Expand Down

0 comments on commit ccf967c

Please sign in to comment.