-
Notifications
You must be signed in to change notification settings - Fork 155
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
fix(gen/tables): passing seed to tables generator #4866
Conversation
35bab66
to
9e77d56
Compare
Adding seed to tables generator to get the very same sequence each time(helpful in writing test) at the moment the seed defaults to the current time, which generates a different sequence each time. useful in #4307
stdlib/internal/gen/tables.go
Outdated
@@ -26,6 +26,7 @@ type TablesOpSpec struct { | |||
N int `json:"n"` | |||
Tags []Tag `json:"tags,omitempty"` | |||
Nulls float64 `json:"nulls,omitempty"` | |||
Seed int64 `json:"Seed,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you will want this to be a pointer, otherwise omitting the seed
parameter default to using 0
as the seed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching that @Marwes
stdlib/internal/gen/tables.go
Outdated
@@ -116,6 +123,7 @@ func newTablesProcedure(qs flux.OperationSpec, pa plan.Administration) (plan.Pro | |||
schema := gen.Schema{ | |||
NumPoints: spec.N, | |||
Nulls: spec.Nulls, | |||
Seed: &spec.Seed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be nil if the seed is not specified in the function call
Adding seed to tables generator to get the very same sequence each time(helpful in writing test)
at the moment the seed defaults to the current time, which generates a different sequence each time.
useful in #4307
Done checklist