feat: Add json_mode to JS transformation - #444
Conversation
json_mode to transformationssnowplow_mode_v2 to JS transformation
|
One minor quip about naming: if this supports any JSON input and snowplow TSV, then Also, I see we try to parse as tsv and if that fails, parse as json. Is that going to add any unnecessary overhead in cases where we know the input is always going to be json? Or are we not concerned about that? |
|
It's a bit rock and hard place Phil Catterall (@phil-snowplow) - I'm happy to hear suggestions for a better name!
My take is this:
Nothing actually changes for someone whose data was another JSON - except that there's now a workaround. I'd rather not have that be advertised support for any JSON, simply because I don't think there's any real ask from users to do so. So I'm ok with it being named this even though it happens to also do something else. I guess the goal isn't to describe the precise functionality as accurately as possible, but to describe the use case we're supporting with it. Which leads to the answer to:
Yeah it does, if we were doing generic JSON support I'd have a concern and design it differently, but because we're supporting a specific internal use case here, I don't. The order of operations should be TSV first because that's the prod scenario where latency matters. The other use case is in a testing flow so it's fine to have the extra bit of work. Next breaking release I think we should clean this up. Then, we can do it as follows:
|
on this one I'd probably suggest something a bit more breaking, but making more sense long-term from there on, we would be able to add support for anything else (be it CSV or just plain strings) with clearer logic how it gets transformed |
colmsnowplow that's a fair point – if we assume JSON mode won't be used at scale, just for testing, and if we're purposefully avoiding breaking changes, I agree the current approach is the best one. Then, we can backlog Mikhail (@oo-sleeper)'s suggestion for the next time we want to do a breaking release. |
b89fd47 to
3bd0e8a
Compare
95e5daa to
906ef7a
Compare
colmsnowplow
left a comment
There was a problem hiding this comment.
Looks good! Please Rename PR and clean up/give it an accurate commit name once you're done.
snowplow_mode_v2 to JS transformationjson_mode to JS transformation
revert changes made to JQ transformation update code as per ticket discussion; update tests fix config tests address comments clecar up SpModeV2 tests; disable interState for SpModeV2 remove config update cleanup the test update test case improve tests fix test revert back to json_mode only
60dd911 to
34dde3c
Compare
ref PDP-1983
json_modeis a new setting for JS transformation, which should make it more transparent into what data is expected as an input to the transformations