Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,22 +174,6 @@ If you need the same result on both backends, use the same backend for planning

---

## Known differences between pandas and Polars

The two backends do not give the same result in these cases.
`tests/test_known_differences.py` checks that each row is still true.

| Case | pandas | Polars |
|---|---|---|
| Currency strings such as `"$1,200"` | Parses them to `float64` (`parse_currency`) | Keeps them as strings |
| Blank strings such as `""` or `" "` | Strips them to null | Strips them to `""` |
| Fill values and IQR fences | Computed after earlier actions, for example after `drop_nulls` or `drop_duplicates` | Computed on the input frame, in one planning query |
| Replaying a plan on new data | Uses the fill value stored in the plan | Computes the fill value again on the new data |
| `report.original_rows` and `report.cleaned_rows` for a `LazyFrame` | Not applicable | `0`, because counting rows would read the data |
| Row order after `drop_duplicates` | Keeps the first row of each group, in order | Does not keep the order (`maintain_order=False`) |

---

## Upgrading from v2.x

If you are upgrading from `freshdata` 2.x (`freshdata-cleaner`), run the included `libcst` codemod to rewrite legacy wrappers (`clean_csv`, `fill_missing`, `compare_plans`, etc.) into the v3.0 core API:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_known_differences.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def _both(data, cfg=None):
fd.apply_plan(pldf, fd.suggest_plan(pldf, cfg), cfg))


def test_readme_has_the_section():
assert "## Known differences between pandas and Polars" in README
def test_readme_has_the_section_once():
assert README.count("## Known differences between pandas and Polars") == 1


def test_currency_strings():
Expand Down
Loading