Skip to content

feat(Taxonomy): children method parity with parent methods#467

Open
Freso wants to merge 4 commits intoopenfoodfacts:developfrom
Freso:feat/taxonomy-child-methods
Open

feat(Taxonomy): children method parity with parent methods#467
Freso wants to merge 4 commits intoopenfoodfacts:developfrom
Freso:feat/taxonomy-child-methods

Conversation

@Freso
Copy link
Copy Markdown
Contributor

@Freso Freso commented Mar 31, 2026

Description

  • There are currently a handful of functions that handle parentage lookups. Two of these methods currently only exist for parents and are a lacking a “child” equivalent.

Solution

  • This adds TaxonomyNode.is_child_of() and .get_children_hierarchy(), copying the logic of their parent[s] method equivalents.

Related issue(s)

There are currently a handful of functions that handle parentage
lookups. Two of these methods currently only exist for parents and
are a lacking a “child” equivalent.

This adds TaxonomyNode.is_child_of() and .get_children_hierarchy(),
copying the logic of their `parent[s]` method equivalents.
@Freso Freso force-pushed the feat/taxonomy-child-methods branch from 5e59f79 to f519cec Compare March 31, 2026 10:59
@sonarqubecloud
Copy link
Copy Markdown

@github-project-automation github-project-automation Bot moved this from In progress to Reviewer approved in 🐍 Python SDK - Keep on par with the API Apr 25, 2026
@raphodn raphodn changed the title feat(TaxonomyNode): children method parity with parent methods feat(Taxonomy): children method parity with parent methods Apr 25, 2026
Comment thread src/openfoodfacts/taxonomy.py
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 1, 2026

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 1, 2026

),
(
category_taxonomy,
"en:brown-rices",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tests depend on the actual taxonomy.. which means that if the brown-rices sub-categories change, well the test will fail and need to be updated 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants