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
fixed street address transformer and POC for seeds #1339
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
worker/internal/benthos/transformers/generate_street_address.go
Outdated
Show resolved
Hide resolved
worker/internal/benthos/transformers/generate_street_address_test.go
Outdated
Show resolved
Hide resolved
worker/internal/benthos/transformers/generate_street_address.go
Outdated
Show resolved
Hide resolved
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 this overall looks good. Looks like there will be some subset of transformers that will require updating in order to facilitate this randomizer update.
Up to you if you'd rather separate the seed POC into a separate PR and get the City fix merged in first.
seed, err := args.GetOptionalInt64("seed") | ||
if err != nil { | ||
return nil, err | ||
} | ||
var randomizer *rand.Rand | ||
if seed == nil { | ||
randomizer = rand.New(rand.NewSource(rand.Int63())) | ||
} else { | ||
randomizer = rand.New(rand.NewSource(*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.
Separately, we'll probably want to pull this into a func so that other transformers can more easily instantiate a randomizer.
seed, err := args.GetOptionalInt64("seed")
if err != nil {
return nil, err
}
randomizer := getRandomizer(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.
yeah im gonna fix the street address one, and then split this out into a separte PR and then come back to it later this week
No description provided.