Skip to content

Conversation

@leostimpfle
Copy link
Collaborator

Closes #991

@leostimpfle leostimpfle requested a review from s3alfisc December 16, 2025 22:03
@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
core-tests 75.81% <100.00%> (?)
tests-extended ?
tests-vs-r 16.14% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pyfixest/estimation/FormulaParser.py 96.46% <100.00%> (+29.63%) ⬆️
pyfixest/estimation/model_matrix_fixest_.py 91.00% <100.00%> (+10.00%) ⬆️

... and 41 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leostimpfle leostimpfle marked this pull request as draft December 16, 2025 22:25
@leostimpfle leostimpfle marked this pull request as ready for review December 16, 2025 23:11
@leostimpfle
Copy link
Collaborator Author

leostimpfle commented Dec 17, 2025

I should clarify that this PR allows using spaces in variable names. For example, the following works

import pyfixest as pf
import polars as pl

data = pl.DataFrame({"Y": [1, 2, 3], "cat": ["cat 1", "cat 2", "cat 2"]}).cast(
    {"cat": pl.Categorical}
)

pf.feols("Y ~ i(cat, ref='cat 2')", data=data)

This is achieved by updating _deparse_fml to preserve spaces and a few tweaks around FormulaParser which essentially make formula parsing whitespace aware (by using re.split instead of str.split).

@leostimpfle leostimpfle merged commit ec8ec6d into master Dec 21, 2025
9 checks passed
@leostimpfle leostimpfle deleted the issue991 branch December 21, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

i() errors if the reference category contains some white space

3 participants