-
Notifications
You must be signed in to change notification settings - Fork 288
Json matching & tests for sqeleton PR #15 #383
Conversation
Hi @nicolasaldecoa , The right way to go about it, imho, is to pass |
As for what to do when fields are the same but have different format, I suggest printing a warning, once per column. (per row would be too much) |
That's a good idea, I'll implement that.
great, I should be able to work with that. If you are OK with it, I'll wait until you have the time to make a commit with what's left in the tests, I got a bit lost on that code. |
Not sure what you mean? The way you added the tests seems okay, on a cursory glance |
Oh, I meant that because I wasn't able to get up the docker compose with the mock dbs locally, I didn't run any tests myself. postgres
redshift
|
Ah, got it. But it should work with any database you connect to, doesn't have to use our own dockers. Just look at |
OK, thank you for the comments. I've updated both PRs (this one and the one in sqeleton; I think this should be ready to be reviewed. |
Hello Devs/Maintainers, What this PR does is a start, but it only handles simple objects. I'm not sure if it is worth it to add a feature with these limitations, and otherwise adding a lot of custom logic can be cumbersome. The problem that we've encountered with this data-type is that many times there are differences, but those are just artifacts of how the DBs handle these objects and we just want to ignore them. But that's a bit subjective and can be hard to come up with a solution that works for many different users. |
The broken tests are to be fixed in #553. |
Related to sqeleton PR # 15.
Tests
can someone help me out with the rest of the code needed for the tests to work?
This sqeleton branch has to be installed in order to test this PR.
Json comparison
I also have the following questions about decisions that have to be made regarding false positives/false negatives detection:
how can we pass a boolean to
diff_sets
to indicate whether there are any extra columns of jsontype and avoid checking that every time?what should we do when we detect diffs that are caused by distinct serialization (
diffs_are_equiv_jsons
returns True) ? IMO the default behavior should be ignoring it, but some users might consider it a difference if the fields don't have exactly the same format (in postrgreSQL I'm pretty sure that this only makes sense with 'json' which keeps the format, but 'bjson' is serialized using a pretty_print function and doesn't care about the original json string that was inserted).Thanks, hope this helps