Repository navigation
Destination S3 Data Lake: Write objects+unions as stringified json - #51042
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Johnny Schmidt (@johnny-schmidt) PR is generally still in draft, but can you take a look at the second two commits? (https://github.com/airbytehq/airbyte/pull/51042/files/650337c31fb863d8ef61e040832e37944d45608c..be76c2277466cdd31330d49b930c211c48da14e6) i.e.
just want to check if there's a better way to accomplish this / if I missed some weird behavior |
4de20b9 to
be76c22
Compare
|
Francis Genet (@frifriSF59) I pushed a few commits to address the stuff we talked about live + your PR comments https://github.com/airbytehq/airbyte/pull/51042/files/ea27d7a0c6bbab28faf955febb43ac53907acab2..9003b5006f7b973cb85c7db510c5a1d7b81815bc (CI failures were the compile fail, which is now fixed, and some transient S3 stuff - hopefully should pass on the next try) |
| * [AirbyteValue]. In particular, this class will parse temporal types, and performs some | ||
| * common-sense conversions among numeric types, as well as upcasting any value to StringValue. | ||
| */ | ||
| object AirbyteValueCoercer { |
There was a problem hiding this comment.
+1 pulling this out into its own object
| promoteUnionToObject = false, | ||
| unionBehavior = UnionBehavior.PASS_THROUGH, | ||
| schematizedObjectBehavior = SchematizedNestedValueBehavior.PASS_THROUGH, | ||
| schematizedArrayBehavior = SchematizedNestedValueBehavior.PASS_THROUGH, |
There was a problem hiding this comment.
Dq, why do we need these if we have ExpectedRecordMapper?
There was a problem hiding this comment.
mild opinion, we should keep the expected record mappers as simple as possible (in particular: ideally not even looking at the expected schema), to avoid accidentally papering over bugs in the connector
i.e. when possible, I'd rather make the tests configurable to generate valid expected records, rather than expecting connectors to handle it via an expectedrecordmapper.
(the existing expected record mappers are basically trivial conversions between AirbyteValue types, which I feel better about. But e.g. the object thing would require the mapper to look at the schema, recognize which fields are ObjectType, and prune/null properties - which feels like too much?)
but again, only a mild opinion. This is adding a lot of complexity+repetition in the test code, which is also bad.
There was a problem hiding this comment.
I think you're right as long as we limit the features in the tests to match the features in the CDK.
So: yes to "configure the tests to blobify complex types, validate against schema" (everything under -- CDK -- in types), but no to "configure the tests to merge unions, expect numeric timestamps, etc" (everything under -- CONNECTOR DEV --).
Basically, if you aren't making a change to the CDK, you should not be adding flags to the test framework either?
There was a problem hiding this comment.
This also means that maybe there's a way to use the destination's configuration to configure the tests?
There was a problem hiding this comment.
aha. yeah I think that sounds right. And then we can say - if a toolkit has a (schema/value) mapper, it should probably also provide a corresponding expected record mapper
closes https://github.com/airbytehq/airbyte-internal-issues/issues/11272. Stacked on #51044
see slack. We'll start writing sub-objects as JSON strings instead of deeply-typed structs.
this isn't really the right approach, but it's the shortest path to getting something released for the beta, and Johnny Schmidt (@johnny-schmidt) is working on a refactor in the type/value area anyway
commits in sequence: