Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chaining searches fails to find expected result #1878

Open
braingram opened this issue Dec 17, 2024 · 0 comments
Open

chaining searches fails to find expected result #1878

braingram opened this issue Dec 17, 2024 · 0 comments

Comments

@braingram
Copy link
Contributor

Description of the problem

The docs mention the ability to "chain" searches:
https://asdf.readthedocs.io/en/latest/asdf/features.html#chaining-searches
The shown example works (if type_ is used instead of type) but other chains are not producing the expected result.

Example of the problem

>>> import asdf
>>> af = asdf.AsdfFile({"a": 1, "b": {"c": [1, 2, 3]}})
>>> af.search("c")  # expected
root (AsdfObject)
└─b (dict)
  └─c (list): [1, 2, 3]
>>> af.search("b")  # expected
root (AsdfObject)
└─b (dict): {'c': [1, 2, 3]}
>>> af.search("b").search("c")  # fails to find "c"
No results found

System information

asdf version: main
python version: 3.10
operating system: mac osx

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

No branches or pull requests

1 participant