Skip to content

Commit

Permalink
Support for type inference for DataFrames using the DataFrame Interch…
Browse files Browse the repository at this point in the history
…ange Protocol (#3114)

* Add DataFrame Interchange Protocol types from spec for type checking

* Tests shouldn't fail when pyarrow and vegafusion aren't installed, skip instead

* Compute parse_shorthand based on __dataframe__ when possible

If the pyarrow data interchange module is available and the dataset has a __dataframe__ method, infer column types based on the DataFrame Interchange Protocol.

Fall back to pandas implementation for pandas DataFrames if pyarrow is not available or pandas is older that 1.5.

* Add comment explaining why we uninstall optional dependencies

* Add pandas GitHub issue reference

* Add changelog entry
  • Loading branch information
jonmmease authored Jul 24, 2023
1 parent 87ed2bb commit 836b8cf
Show file tree
Hide file tree
Showing 8 changed files with 613 additions and 11 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ jobs:
pip install .[dev]
# pip install "selenium<4.3.0"
# pip install altair_saver
- name: Maybe uninstall optional dependencies
# We uninstall pyarrow and vegafusion for one job to test that we have not
# accidentally introduced a hard dependency on these libraries.
# Uninstalling for Python 3.9 is an arbitrary choice.
# Also see https://github.com/altair-viz/altair/pull/3114
if: ${{ matrix.python-version }}=="3.9"
run: |
pip uninstall -y pyarrow vegafusion vegafusion-python-embed
- name: Test that schema generation has no effect
run: |
python tools/generate_schema_wrapper.py
Expand Down
Loading

0 comments on commit 836b8cf

Please sign in to comment.