Add Narwhals to package list (#5121)

Narwhals is a lightweight compatibility layer between dataframe libraries, with
zero dependencies. It's now used by Altair, so I'm opening this PR to enable
them to update their version here on Pyodide vega/altair#3642
This commit is contained in:
Marco Edward Gorelli 2024-10-22 08:43:24 +01:00 committed by GitHub
parent 858e0e4424
commit 2cd495b88f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 38 additions and 0 deletions

View File

@ -90,6 +90,7 @@ myst:
- Added `tree-sitter-go` 0.23.1 {pr}`5102`
- Added `tree-sitter-java` 0.23.2 {pr}`5102`
- Added `tree-sitter-python` 0.23.2 {pr}`5102`
- Added `Narwhals` 1.9.4 {pr}`5121`
## Version 0.26.3

View File

@ -0,0 +1,16 @@
package:
name: narwhals
version: 1.10.0
top-level:
- narwhals
source:
url: https://files.pythonhosted.org/packages/82/45/6bb08a5e5ac2d9a95f4116567d0aafb1e5f86c4bbcf982e209e5ae872b3d/narwhals-1.10.0-py3-none-any.whl
sha256: c83a378960651c391e5f3d68af3a821eda74c9713073518fe0c39aefc5ad8f8e
about:
home: https://github.com/narwhals-dev/narwhals
PyPI: https://pypi.org/project/narwhals
summary: Extremely lightweight compatibility layer between dataframe libraries
license: MIT
extra:
recipe-maintainers:
- MarcoGorelli

View File

@ -0,0 +1,21 @@
from pytest_pyodide import run_in_pyodide
@run_in_pyodide(packages=["narwhals"])
def test_narwhals_from_native(selenium):
import narwhals as nw
class MyDictDataFrame:
def __init__(self, data):
self._data = data
def __narwhals_dataframe__(self):
return self
@property
def columns(self):
return list(self._data)
assert nw.from_native(
MyDictDataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
).columns == ["a", "b"]