Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.

refactor: Tree traversals now non-recursive#1386

Merged
TrevorBergeron merged 2 commits into
mainfrom
iterative_traversal
Feb 12, 2025
Merged

refactor: Tree traversals now non-recursive#1386
TrevorBergeron merged 2 commits into
mainfrom
iterative_traversal

Conversation

@TrevorBergeron
Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@product-auto-label product-auto-label Bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Feb 11, 2025
@TrevorBergeron TrevorBergeron marked this pull request as ready for review February 11, 2025 23:33
@TrevorBergeron TrevorBergeron requested review from a team and sycai February 11, 2025 23:33
Comment thread bigframes/core/plan.py Outdated
from typing import Callable, Dict, Generator, Iterable, Mapping, Set, Tuple

import bigframes.core.guid
import bigframes.core.identifiers
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here we have two imports for the same module.

Could you use from bigframes.core import identifiers and resolve all module references? go/pydev#imports

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok, yeah, that is nicer, done

Comment thread bigframes/core/plan.py Outdated
for child in item.child_nodes:
yield (item, child)

def topo(self: BigFrameNode) -> Generator[BigFrameNode, None, None]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

name suggestion: topo_ordered_nodes or get_nodes_in_topo_order or something similar to reflect the fact that we are returning a collection of nodes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

renamed to iter_nodes_topo

Comment thread bigframes/core/plan.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's update the filename with anything that accurately describes the content, and preferably ends with "node"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

renamed to bigframe_node.py

@TrevorBergeron TrevorBergeron requested a review from sycai February 12, 2025 01:35
@TrevorBergeron TrevorBergeron merged commit 64b5ff1 into main Feb 12, 2025
@TrevorBergeron TrevorBergeron deleted the iterative_traversal branch February 12, 2025 04:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants