Closed gt732 closed 1 year ago
Hi, I'm not sure where the model = {"item": Item}
syntax came from, but after changing it to:
class SourceAdapter(DiffSync):
"""Source Adapter with the initial dataset."""
item = Item
top_level = ["item"]
def load(self):
# ...
class TargetAdapter(DiffSync):
"""Target Adapter with fewer items than the Source Adapter."""
item = Item
top_level = ["item"]
def load(self):
# ...
things work just fine:
Source data: [item "1", item "2", item "3"]
Target data: [item "1", item "3"]
2023-10-17 20:48.45 [debug ] Diff calculation between these two datasets will involve 5 models [diffsync.helpers] dst=<TargetAdapter> flags=<DiffSyncFlags.NONE: 0> src=<SourceAdapter>
2023-10-17 20:48.45 [info ] Beginning diff calculation [diffsync.helpers] dst=<TargetAdapter> flags=<DiffSyncFlags.NONE: 0> src=<SourceAdapter>
2023-10-17 20:48.45 [info ] Diff calculation complete [diffsync.helpers] dst=<TargetAdapter> flags=<DiffSyncFlags.NONE: 0> src=<SourceAdapter>
item
item: 2 MISSING in TargetAdapter
@glennmatthews Thank you that worked! Massive brain fart today :(
Environment
Observed Behavior
When using the diffsync library to compare datasets between a "source" and a "target," the diffing process does not detect missing items in the target that exist in the source. Specifically, when an item is present in the source dataset but not in the target, the diff_to() method does not flag this inconsistency. The output indicates "(no diffs)" even though there is a clear discrepancy in the datasets.
Expected Behavior
It's expected that if an item exists in the source dataset and not in the target, the diffing process should identify this and report the item as missing from the target. The detailed report should list all discrepancies between the source and target datasets, including any items that are present in one but not the other.
Steps to Reproduce
Results