Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyfixest_core"
version = "0.50.0"
version = "0.50.1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
8 changes: 7 additions & 1 deletion docs/changelog.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ fit2 = pf.feols("Y ~ X1 + X2", data = df)
fit3 = pf.feols("Y ~ X1 + X2 | f1", data = df)
```

## PyFixest 0.50.0 (In Development)
## PyFixest 0.50.1

### Bug Fixes

- Fixes an import-time failure on Python 3.13 in some environments where a `narwhals` typing alias was exposed as a string at runtime. This could cause imports of `feols()` / `feglm()` to fail before any model code ran. See [#1263](https://github.com/py-econometrics/pyfixest/issues/1263) for details.

## PyFixest 0.50.0

::: {.callout-tip}
You can install the latest pre-release to try out the new features:
Expand Down
2 changes: 2 additions & 0 deletions pyfixest/estimation/FixestMulti_.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import functools
from collections.abc import Mapping
from importlib import import_module
Expand Down
2 changes: 2 additions & 0 deletions pyfixest/estimation/api/feglm.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from collections.abc import Mapping
from typing import Any

Expand Down
2 changes: 2 additions & 0 deletions pyfixest/estimation/api/feols.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from collections.abc import Mapping
from typing import Any

Expand Down
2 changes: 2 additions & 0 deletions pyfixest/estimation/api/fepois.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from collections.abc import Mapping
from typing import Any

Expand Down
2 changes: 2 additions & 0 deletions pyfixest/estimation/api/quantreg.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from collections.abc import Mapping
from typing import Any

Expand Down
2 changes: 2 additions & 0 deletions pyfixest/estimation/api/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pandas as pd

from pyfixest.utils.dev_utils import DataFrameType, _narwhals_to_pandas
Expand Down
2 changes: 2 additions & 0 deletions pyfixest/estimation/models/feglm_.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from abc import ABC, abstractmethod
from collections.abc import Mapping
from typing import Any, Literal
Expand Down
4 changes: 3 additions & 1 deletion pyfixest/estimation/models/feols_.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import re
import warnings
from collections.abc import Callable, Mapping
Expand Down Expand Up @@ -580,7 +582,7 @@ def vcov(
vcov: str | dict[str, str],
vcov_kwargs: dict[str, str | int] | None = None,
data: DataFrameType | None = None,
) -> "Feols":
) -> Feols:
"""
Compute covariance matrices for an estimated regression model.
Expand Down
2 changes: 2 additions & 0 deletions pyfixest/estimation/models/feols_compressed_.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import logging
from collections.abc import Mapping
from dataclasses import dataclass
Expand Down
2 changes: 2 additions & 0 deletions pyfixest/estimation/models/fepois_.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import re
import warnings
from collections.abc import Mapping
Expand Down
2 changes: 2 additions & 0 deletions pyfixest/estimation/post_estimation/prediction.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import re
import warnings
from collections.abc import Mapping
Expand Down
2 changes: 2 additions & 0 deletions pyfixest/estimation/quantreg/QuantregMulti.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import gc
import inspect
from collections.abc import Mapping
Expand Down
34 changes: 34 additions & 0 deletions tests/test_import_annotations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import subprocess
import sys
import textwrap
from pathlib import Path


def test_stringified_dataframe_type_does_not_break_model_import():
repo_root = Path(__file__).resolve().parents[1]
script = textwrap.dedent(
f"""
import importlib
import sys

sys.path.insert(0, {str(repo_root)!r})

import pyfixest.utils.dev_utils as dev_utils

# Reproduce the older narwhals behavior reported in issue #1263, where
# the imported typing alias behaved like a string at runtime.
dev_utils.DataFrameType = "IntoDataFrame"

importlib.import_module("pyfixest.estimation.models.feglm_")
"""
)

result = subprocess.run(
[sys.executable, "-c", script],
capture_output=True,
text=True,
cwd=repo_root,
check=False,
)

assert result.returncode == 0, result.stderr or result.stdout
Loading