tamnd / tamnd/firepanda

Five keyword arguments the Python binding does not take

Open
#329 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Mojo
Stars
1
Forks
0
Avg merge
1h 31m
Merged PRs (30d)
640

Description

The compat board grew a reflection instrument ([firepanda-compat #70](https://github.com/tamnd/firepanda-compat/pull/70)), which means the 1034 generated `signature` cases can be asked for the first time. They compare the parameter list of every public pandas callable against the firepanda spelling of the same name. 72 of them pass today and five fail.

| name | firepanda takes | pandas also takes |
| --- | --- | --- |
| `Index.rename` | `name` | `inplace` |
| `Index.slice_locs` | `start`, `end` | `step` |
| `Index.take` | `indices` | `axis`, `allow_fill`, `fill_value` |
| `Index.unique` | nothing | `level` |
| `pandas.read_csv` | `filepath_or_buffer` | everything after it |

These are gaps in `python/firepanda`, not in the Mojo library. They were invisible until now because every other case in the suite is hand written against a case rather than against a signature, and a case that calls `idx.take(indices)` never notices that `allow_fill` is not there. A pandas program that passes one of these gets a `TypeError` at the call site.

The four `Index` ones are small and mostly mean threading an existing capability out to the binding. `read_csv` is not small and is not one decision, since pandas takes something over fifty parameters there and they range from trivial to a parser rewrite.

The thing to settle before any of them is what an unimplemented keyword does when somebody passes it, because it is the same question five times and it should get one answer. The candidates are to accept and ignore it, to accept it and raise `NotImplementedError` when the value is not the default, or to leave it out of the signature so the call fails as it does today. Accepting and ignoring is the one that silently returns a wrong answer, which is worse than the `TypeError`. This is the error model question that [#301](https://github.com/tamnd/firepanda/issues/301) and the astype work both bounced off, and it is worth deciding once here rather than five times in a row.

Adding a parameter name with nothing behind it would also turn five honest failures on the board into five passes and one lie, which is why the compat side left them failing and filed this instead.

Contributor guide

Open the contributing guide

Research direction

Start with the reflection-based signature cases in the compat board and the corresponding implementations under python/firepanda. First settle the shared behavior for unsupported keyword arguments, then assess the four Index gaps separately from the larger pandas.read_csv scope. Done means the chosen error model is consistent and supported arguments behave correctly without turning unimplemented parameters into false compatibility passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.