Open kolina opened 2 months ago
- We should be catching this during the proto validation https://github.com/dataform-co/dataform/blob/05341b7c2e8f6e55a7002ed29b4ff4a7e2cbf12b/common/protos/index.ts#L53
I also hoped that it should have been the case, but unfortunately this code https://github.com/dataform-co/dataform/blob/05341b7c2e8f6e55a7002ed29b4ff4a7e2cbf12b/common/protos/index.ts#L45-L46 doesn't validate types and actually allows to create protoCastObject
where defaultDataset
has an integer type and this check later doesn't work https://github.com/dataform-co/dataform/blob/05341b7c2e8f6e55a7002ed29b4ff4a7e2cbf12b/common/protos/index.ts#L53
The thing that actually verifies types is protoType.verify()
. WDYT about using it?
.verify()
is a lie, it doesn't actually do anything - there are no situations where the call will actually fail.
Currently if
defautProject
ordefaultDataset
have an integer type inworkflow_settings.yaml
, a compilation will throw a not very obvious error liket.target.schema.includes is not a function
. I've added a validation of these fields to be strings (if not, an explicit error is thrown).