feat: add programmatic Report API with structured comparison data#532
Conversation
…Pandas and Polars backends
… DataFrame shape and column names
…red comparison data
… unnecessary changes
…or report rendering and HTML saving
…es for report rendering and HTML saving
…ss references and use ReportData directly
…nd improve example template
rhaffar
left a comment
There was a problem hiding this comment.
I like the centralizing of our reporting logic here - it's so similar between the different backends, I think keeping that intent in one spot makes more sense than re-implementing it for each backend. No real gripes from me here on any of these changes - just a few small comments.
| @@ -703,246 +700,6 @@ def all_mismatch(self, ignore_matching_cols: bool = False) -> pl.DataFrame: | |||
| .select(self.join_columns + return_list) | |||
| ) | |||
|
|
|||
There was a problem hiding this comment.
I'm guessing the polars compare doesn't implement _select_first_n_columns and _column_names since it's using the default implementation? If all the other compare classes have to overwrite it anyways, might opt to just make the base class method abstract and force all compare classes to implement them.
There was a problem hiding this comment.
I think I'd like to leave this as is for now. Maybe we can have an offline discussion about this? Just want to avoid duplication here as much as possible.
Closes #531
ReportDatadataclass indatacompy/report.pythat exposes structured comparison results (mismatches, unmatched rows, column stats) as a programmatic API, accessible via a new.reportproperty on all compare classesdatacompy/base.py, removing duplicated summary methods frompandas.py,polars.py,snowflake.py, andspark.pydocs/source/report_api.rstdocumenting the new API and updates the template guide.