Skip to content

Commit ad508fb

Browse files
committed
feat: Add error handling and type inference for f2a library
- Introduced a new error handling module (`errors.rs`) with custom error types for various failure scenarios. - Implemented a type inference function (`infer_column_type`) in `types.rs` to determine semantic column types based on Polars data types and statistics. - Created a comprehensive end-to-end test suite (`test_e2e.py`) to validate the functionality of the f2a library across multiple data formats and analysis configurations. - Added unit tests for core functionalities, including import checks, version validation, and analysis configuration presets. - Enhanced report generation tests to ensure HTML output and internationalization support. - Established pytest fixtures for reusable test data across multiple test cases.
1 parent c1a7021 commit ad508fb

124 files changed

Lines changed: 13945 additions & 28531 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# ──────────────────────────────────────────────────────────────
2+
# f2a CI — Lint, build, test on every push / PR
3+
#
4+
# IMPORTANT:
5+
# - Uses pip exclusively. Do NOT add uv/astral-sh actions.
6+
# - maturin builds from source on each platform (no pre-built wheels).
7+
# ──────────────────────────────────────────────────────────────
8+
name: CI
9+
10+
on:
11+
push:
12+
branches: [main]
13+
pull_request:
14+
branches: [main]
15+
16+
concurrency:
17+
group: ci-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: read
22+
23+
env:
24+
PIP_DISABLE_PIP_VERSION_CHECK: "1"
25+
PYTHONDONTWRITEBYTECODE: "1"
26+
27+
jobs:
28+
# ── Rust check & clippy ───────────────────────────────────
29+
rust-check:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- name: Install Rust toolchain
35+
uses: dtolnay/rust-toolchain@stable
36+
with:
37+
components: clippy, rustfmt
38+
39+
- name: Cache cargo
40+
uses: actions/cache@v4
41+
with:
42+
path: |
43+
~/.cargo/bin
44+
~/.cargo/registry/index
45+
~/.cargo/registry/cache
46+
~/.cargo/git/db
47+
target
48+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
49+
restore-keys: ${{ runner.os }}-cargo-
50+
51+
- name: cargo fmt --check
52+
run: cargo fmt --all -- --check
53+
54+
- name: cargo clippy
55+
run: cargo clippy --all-targets -- -D warnings
56+
57+
- name: cargo test
58+
run: cargo test --release
59+
60+
# ── Python test matrix ────────────────────────────────────
61+
test:
62+
needs: rust-check
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
os: [ubuntu-latest, windows-latest, macos-14]
67+
python-version: ["3.10", "3.11", "3.12", "3.13"]
68+
exclude:
69+
# Cross-platform spot-check: full Python matrix on Linux only,
70+
# 3.12 on Windows/macOS to save CI minutes.
71+
- os: windows-latest
72+
python-version: "3.10"
73+
- os: windows-latest
74+
python-version: "3.11"
75+
- os: windows-latest
76+
python-version: "3.13"
77+
- os: macos-14
78+
python-version: "3.10"
79+
- os: macos-14
80+
python-version: "3.11"
81+
- os: macos-14
82+
python-version: "3.13"
83+
84+
runs-on: ${{ matrix.os }}
85+
steps:
86+
- uses: actions/checkout@v4
87+
88+
- name: Install Rust toolchain
89+
uses: dtolnay/rust-toolchain@stable
90+
91+
- name: Set up Python ${{ matrix.python-version }}
92+
uses: actions/setup-python@v5
93+
with:
94+
python-version: ${{ matrix.python-version }}
95+
96+
- name: Cache cargo
97+
uses: actions/cache@v4
98+
with:
99+
path: |
100+
~/.cargo/bin
101+
~/.cargo/registry/index
102+
~/.cargo/registry/cache
103+
~/.cargo/git/db
104+
target
105+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
106+
restore-keys: ${{ runner.os }}-cargo-
107+
108+
- name: Build extension (maturin develop)
109+
shell: bash
110+
run: |
111+
python -m pip install --upgrade pip maturin
112+
maturin develop --release
113+
114+
- name: Install test dependencies
115+
shell: bash
116+
run: |
117+
python -m pip install pytest pandas numpy matplotlib seaborn scipy pyarrow rich jinja2
118+
119+
- name: Run tests
120+
run: python -m pytest tests/ -v --tb=short

.github/workflows/pages.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)