Skip to content

AttributeError: '_SeriesFromNest' object has no attribute 'nest_name' #405

@hombit

Description

@hombit

Bug report

From @mi-dai. With a specific python environment and the latest nested-pandas 0.6.1, a simple query fails

import nested_pandas as npd

npd.read_parquet('lc_head.parquet').query("lc.filter == 'r'")
~/.virtualenvs/mi-nested-pandas/lib/python3.11/site-packages/nested_pandas/nestedframe/core.py in ?(self, expr, inplace, **kwargs)
   1467         # which means that a nested attribute was referenced.  Apply this result
   1468         # to the nest and repack.  Otherwise, apply it to this instance as usual,
   1469         # since it operated on the base attributes.
   1470         if isinstance(result, _SeriesFromNest):
-> 1471             nest_name, flat_nest = result.nest_name, result.flat_nest
   1472             # Reset index to "ordinal" like [0, 0, 0, 1, 1, 2, 2, 2]
   1473             list_index = self[nest_name].array.get_list_index()
   1474             flat_nest = flat_nest.set_index(list_index)

~/.virtualenvs/mi-nested-pandas/lib/python3.11/site-packages/pandas/core/generic.py in ?(self, name)
   6317             and name not in self._accessors
   6318             and self._info_axis._can_hold_identifiers_and_holds_name(name)
   6319         ):
   6320             return self[name]
-> 6321         return object.__getattribute__(self, name)

AttributeError: '_SeriesFromNest' object has no attribute 'nest_name'

Environment Information

Python 3.11, macOS arm64.

Package list
absl-py                         ==   2.1.0
aiohappyeyeballs                ==   2.4.3
aiohttp                         ==   3.10.8
aiosignal                       ==   1.3.1
alabaster                       ==   1.0.0
alembic                         ==   1.16.4
annotated-types                 ==   0.7.0
anyio                           ==   4.4.0
appnope                         ==   0.1.4
archspec                        ==   0.2.3
argon2-cffi                     ==   23.1.0
argon2-cffi-bindings            ==   21.2.0
arrow                           ==   1.3.0
arviz                           ==   0.22.0
astroid                         ==   3.3.8
astropy                         ==   7.1.0
astropy-iers-data               ==   0.2025.8.25.0.36.58
asttokens                       ==   3.0.0
asv                             ==   0.6.4
asv_runner                      ==   0.2.1
async-lru                       ==   2.0.4
attrs                           ==   23.2.0
Babel                           ==   2.15.0
bayesn                          ==   0.4.0
beautifulsoup4                  ==   4.12.3
bilby                           ==   2.6.0
bilby.cython                    ==   0.5.3
bleach                          ==   6.1.0
blinker                         ==   1.9.0
bokeh                           ==   3.8.0
boltons                         ==   25.0.0
Bottleneck                      ==   1.4.2
Brotli                          ==   1.0.9
brotlicffi                      ==   1.0.9.2
build                           ==   1.2.2
cachetools                      ==   5.5.2
cdshealpix                      ==   0.7.1
certifi                         ==   2025.8.3
cffi                            ==   1.17.1
cfgv                            ==   3.4.0
charset-normalizer              ==   3.3.2
chex                            ==   0.1.87
citation-compass                ==   0.0.6
click                           ==   8.2.1
cloudpickle                     ==   3.1.1
colorama                        ==   0.4.6
comm                            ==   0.2.1
conda-package-handling          ==   2.4.0
conda_package_streaming         ==   0.12.0
contourpy                       ==   1.3.1
corner                          ==   2.2.3
coverage                        ==   7.6.0
cycler                          ==   0.11.0
dask                            ==   2025.9.1
databricks-sdk                  ==   0.58.0
debugpy                         ==   1.8.16
decorator                       ==   5.1.1
defusedxml                      ==   0.7.1
Deprecated                      ==   1.2.18
dill                            ==   0.3.9
distlib                         ==   0.3.8
distributed                     ==   2025.9.1
distro                          ==   1.9.0
docker                          ==   7.1.0
docutils                        ==   0.21.2
dust_extinction                 ==   1.5
dynesty                         ==   2.1.5
emcee                           ==   3.1.6
etils                           ==   1.10.0
executing                       ==   2.2.1
extinction                      ==   0.4.8
fastapi                         ==   0.116.1
fastjsonschema                  ==   2.20.0
filelock                        ==   3.15.4
Flask                           ==   3.1.1
fonttools                       ==   4.55.3
fqdn                            ==   1.5.1
frozendict                      ==   2.4.2
frozenlist                      ==   1.4.1
fsspec                          ==   2025.10.0
gitdb                           ==   4.0.12
GitPython                       ==   3.1.44
google-auth                     ==   2.40.3
graphene                        ==   3.4.3
graphql-core                    ==   3.2.6
graphql-relay                   ==   3.2.0
gunicorn                        ==   23.0.0
h11                             ==   0.14.0
h5netcdf                        ==   1.6.3
h5py                            ==   3.14.0
hats                            ==   0.7.0
healsparse                      ==   1.11.1
hpgeom                          ==   1.4.0
httpcore                        ==   1.0.5
httpx                           ==   0.27.0
identify                        ==   2.6.0
idna                            ==   3.7
imagesize                       ==   1.4.1
iminuit                         ==   2.30.1
importlib_metadata              ==   8.7.0
iniconfig                       ==   2.1.0
ipykernel                       ==   6.25.0
ipython                         ==   9.1.0
ipython_pygments_lexers         ==   1.1.1
ipywidgets                      ==   8.1.3
isoduration                     ==   20.11.0
itsdangerous                    ==   2.2.0
jax                             ==   0.4.38
jaxlib                          ==   0.4.38
jedi                            ==   0.19.2
Jinja2                          ==   3.1.4
joblib                          ==   1.5.2
jproperties                     ==   2.1.2
json5                           ==   0.9.25
jsonpatch                       ==   1.33
jsonpointer                     ==   3.0.0
jsonschema                      ==   4.23.0
jsonschema-specifications       ==   2023.12.1
jupyter                         ==   1.0.0
jupyter_client                  ==   8.6.3
jupyter-console                 ==   6.6.3
jupyter_core                    ==   5.8.1
jupyter-events                  ==   0.10.0
jupyter-lsp                     ==   2.2.5
jupyter_server                  ==   2.14.1
jupyter-server-mathjax          ==   0.2.6
jupyter_server_terminals        ==   0.5.3
jupyterlab                      ==   4.2.3
jupyterlab_pygments             ==   0.3.0
jupyterlab_server               ==   2.27.2
jupyterlab_widgets              ==   3.0.11
kiwisolver                      ==   1.4.8
llvmlite                        ==   0.45.1
locket                          ==   1.0.0
looseversion                    ==   1.3.0
lsdb                            ==   0.7.0
lz4                             ==   4.4.4
Mako                            ==   1.3.10
MarkupSafe                      ==   2.1.5
matplotlib                      ==   3.10.5
matplotlib-inline               ==   0.1.6
mistune                         ==   3.0.2
ml-dtypes                       ==   0.4.0
mlflow-skinny                   ==   3.1.1
mocpy                           ==   0.18.0
msgpack                         ==   1.1.2
multidict                       ==   6.1.0
multipledispatch                ==   1.0.0
narwhals                        ==   2.7.0
nbclient                        ==   0.10.0
nbconvert                       ==   7.16.4
nbdime                          ==   4.0.2
nbformat                        ==   5.10.4
nbsphinx                        ==   0.9.6
nest-asyncio                    ==   1.6.0
nested-pandas                   ==   0.6.1
networkx                        ==   3.5
nodeenv                         ==   1.9.1
notebook                        ==   7.2.1
notebook_shim                   ==   0.2.4
numba                           ==   0.62.1
numexpr                         ==   2.11.0
numpy                           ==   2.3.3
numpyro                         ==   0.18.0
opentelemetry-api               ==   1.35.0
opentelemetry-sdk               ==   1.35.0
opentelemetry-semantic-conventions== 0.56b0
opt-einsum                      ==   3.3.0
optax                           ==   0.2.3
overrides                       ==   7.7.0
packaging                       ==   25.0
pandas                          ==   2.3.3
pandocfilters                   ==   1.5.1
parso                           ==   0.8.4
partd                           ==   1.4.2
pexpect                         ==   4.9.0
photutils                       ==   2.3.0
pillow                          ==   11.3.0
pip                             ==   25.2
platformdirs                    ==   4.3.7
pluggy                          ==   1.5.0
pooch                           ==   1.8.2
pre-commit                      ==   3.7.1
prometheus_client               ==   0.20.0
prompt-toolkit                  ==   3.0.43
protobuf                        ==   6.31.1
psutil                          ==   5.9.0
ptyprocess                      ==   0.7.0
pure_eval                       ==   0.2.3
pyarrow                         ==   18.1.0
pyasn1                          ==   0.6.1
pyasn1_modules                  ==   0.4.2
pycosat                         ==   0.6.6
pycparser                       ==   2.21
pydantic                        ==   2.11.7
pydantic_core                   ==   2.33.2
pyerfa                          ==   2.0.1.5
Pygments                        ==   2.19.1
Pympler                         ==   1.1
pyparsing                       ==   3.2.0
pyproject_hooks                 ==   1.2.0
PySocks                         ==   1.7.1
pytest                          ==   8.4.1
pytest-cov                      ==   5.0.0
python-dateutil                 ==   2.9.0.post0
python-json-logger              ==   2.0.7
pytz                            ==   2025.2
PyYAML                          ==   6.0.2
pyzmq                           ==   26.2.0
pzflow                          ==   3.1.3
qtconsole                       ==   5.5.2
QtPy                            ==   2.4.1
referencing                     ==   0.35.1
regions                         ==   0.10
requests                        ==   2.32.5
rfc3339-validator               ==   0.1.4
rfc3986-validator               ==   0.1.1
roman-numerals-py               ==   3.1.0
rpds-py                         ==   0.19.0
rsa                             ==   4.9.1
ruamel.yaml                     ==   0.18.10
ruamel.yaml.clib                ==   0.2.12
ruff                            ==   0.5.1
scipy                           ==   1.16.0
Send2Trash                      ==   1.8.3
setuptools                      ==   72.1.0
sfdmap2                         ==   0.2.2.post3
six                             ==   1.17.0
smmap                           ==   5.0.2
sncosmo                         ==   2.12.1
sniffio                         ==   1.3.1
snowballstemmer                 ==   2.2.0
sortedcontainers                ==   2.4.0
soupsieve                       ==   2.5
Sphinx                          ==   8.2.1
sphinx-autoapi                  ==   3.6.0
sphinx-copybutton               ==   0.5.2
sphinx_design                   ==   0.6.1
sphinx-rtd-theme                ==   3.0.2
sphinxcontrib-applehelp         ==   2.0.0
sphinxcontrib-devhelp           ==   2.0.0
sphinxcontrib-htmlhelp          ==   2.1.0
sphinxcontrib-jquery            ==   4.1
sphinxcontrib-jsmath            ==   1.0.1
sphinxcontrib-qthelp            ==   2.0.0
sphinxcontrib-serializinghtml   ==   2.0.0
sqlparse                        ==   0.5.3
stack_data                      ==   0.6.3
starlette                       ==   0.47.1
synphot                         ==   1.6.0
tabulate                        ==   0.9.0
tblib                           ==   3.1.0
terminado                       ==   0.18.1
tinycss2                        ==   1.3.0
toolz                           ==   1.0.0
tornado                         ==   6.5.1
tqdm                            ==   4.67.1
traitlets                       ==   5.14.3
truststore                      ==   0.10.1
types-python-dateutil           ==   2.9.0.20240316
typing_extensions               ==   4.14.1
typing-inspection               ==   0.4.1
tzdata                          ==   2025.2
unicodedata2                    ==   15.1.0
universal_pathlib               ==   0.2.6
uri-template                    ==   1.3.0
urllib3                         ==   2.5.0
uvicorn                         ==   0.35.0
VBMicrolensing                  ==   5.3.3
virtualenv                      ==   20.26.3
wcwidth                         ==   0.2.13
webcolors                       ==   24.6.0
webencodings                    ==   0.5.1
websocket-client                ==   1.8.0
Werkzeug                        ==   3.1.3
wheel                           ==   0.45.1
widgetsnbextension              ==   4.0.11
wrapt                           ==   1.17.3
xarray                          ==   2025.7.0
xarray-einstats                 ==   0.9.1
xyzservices                     ==   2025.4.0
yarl                            ==   1.13.1
zict                            ==   3.0.0
zipp                            ==   3.23.0
zstandard                       ==   0.23.0

Example parquet file: https://drive.google.com/file/d/16qr_9BeIdIhtiSvDBk3RsQ5C3HRNhU2Z/view?usp=share_link

Before submitting
Please check the following:

  • I have described the situation in which the bug arose, including what code was executed, and any applicable data others will need to reproduce the problem.
  • I have included information about my environment, including the version of this package (e.g. nested_pandas.__version__)
  • I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a description of what I expected instead.
  • If I have a solution in mind, I have provided an explanation and/or pseudocode and/or task list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions