feat: add ConstructorEager type
What type of PR is this? (check all applicable)
- [x] 💾 Refactor
- [ ] ✨ Feature
- [ ] 🐛 Bug Fix
- [ ] 🔧 Optimization
- [ ] 📝 Documentation
- [x] ✅ Test
- [ ] 🐳 Other
Related issues
- Related issue #
- Closes #1013
Checklist
- [ ] Code follows style guide (ruff)
- [ ] Tests added
- [ ] Documented the changes
If you have comments or can explain your changes, please do so below.
Getting some issues with type checking.
tests/expr_and_series/sort_test.py:30: error: Item "NativeFrame" of "NativeFrame | DataFrame[Any] | DataFrameLike" has no attribute "equals" [union-attr]
tests/expr_and_series/sort_test.py:30: error: Item "DataFrame[Any]" of "NativeFrame | DataFrame[Any] | DataFrameLike" has no attribute "equals" [union-attr]
tests/expr_and_series/sort_test.py:30: error: Item "DataFrameLike" of "NativeFrame | DataFrame[Any] | DataFrameLike" has no attribute "equals" [union-attr]
Should I also add equals to the NativeFrame protocol?
EDIT:
I ended up removing the typehint on sort_test.py:30 as I don't think any dataframe would have the equals method (?)
~Not sure how to handle the mypy failure on interchange_to_arrow_test and interchange_schema_test this time.
@FBruzzesi , perhaps you could have a look? I am sure I am missing something very obvious haha~
Solved
Getting some issues with type checking.
tests/expr_and_series/sort_test.py:30: error: Item "NativeFrame" of "NativeFrame | DataFrame[Any] | DataFrameLike" has no attribute "equals" [union-attr] tests/expr_and_series/sort_test.py:30: error: Item "DataFrame[Any]" of "NativeFrame | DataFrame[Any] | DataFrameLike" has no attribute "equals" [union-attr] tests/expr_and_series/sort_test.py:30: error: Item "DataFrameLike" of "NativeFrame | DataFrame[Any] | DataFrameLike" has no attribute "equals" [union-attr]Should I also add
equalsto the NativeFrame protocol?EDIT: I ended up removing the typehint on
sort_test.py:30as I don't think any dataframe would have theequalsmethod (?)
I think you can rewrite the test as follows:
result = (
df.select(
"a",
nw.col("b").sort(descending=descending, nulls_last=nulls_last),
)
)
compare_dicts(result, expected)
This has been stale for a while. I'll try to make it right this weekend 🔥
Many thanks @MarcoGorelli ! I will merge it now🎉