-
Notifications
You must be signed in to change notification settings - Fork 4
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
specgen: re-enable unit tests #217
Conversation
ac63a46
to
2c6046d
Compare
2c6046d
to
ec9fe4d
Compare
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.
Just a question
@@ -126,7 +126,7 @@ type DestinationWithBatch struct { | |||
// Maximum size of batch before it gets written to the destination. | |||
BatchSize int `json:"sdk.batch.size" default:"0" validate:"gt=-1"` | |||
// Maximum delay before an incomplete batch is written to the destination. | |||
BatchDelay time.Duration `json:"sdk.batch.delay" default:"0" validate:"gt=-1"` | |||
BatchDelay time.Duration `json:"sdk.batch.delay" default:"0"` |
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.
Why removing the previous validation?
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.
Because it actually isn't something we support: #54. I guess that Lovro was initially experimenting with it, and found that we don't support gt
and lt
validations for time.Duration
.
@@ -139,6 +139,10 @@ type SourceWithSchemaExtraction struct { | |||
// todo: use https://github.com/ConduitIO/conduit-commons/issues/142 to parse | |||
// the string value into schema.Type directly. | |||
func (c *SourceWithSchemaExtraction) SchemaType() schema.Type { | |||
if c.SchemaTypeStr == "" { | |||
return schema.TypeAvro |
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.
(thinking out loud) Could we initialize it with this value when instantiating SourceWithSchemaExtraction
?
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 that would work if we constraint ourselves to always use a constructor method. It's not terrible, but unless we make the type unexported we can't really force anyone to use the constructor method. I believe that in most cases this should be enough, because when the config is parsed using the sdk.Util.ParseConfig
function, the default should be set (because we have the default
tag).
Description
Closes #214.
Quick checks: