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

refactor: Tree traversals now non-recursive #1386

Merged
merged 2 commits into from
Feb 12, 2025
Merged

Conversation

TrevorBergeron
Copy link
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 as code owners February 11, 2025 23:33
@TrevorBergeron TrevorBergeron requested a review from sycai February 11, 2025 23:33
from typing import Callable, Dict, Generator, Iterable, Mapping, Set, Tuple

import bigframes.core.guid
import bigframes.core.identifiers
Copy link
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
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

for child in item.child_nodes:
yield (item, child)

def topo(self: BigFrameNode) -> Generator[BigFrameNode, None, None]:
Copy link
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
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

Copy link
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
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
23 checks passed
@TrevorBergeron TrevorBergeron deleted the iterative_traversal branch February 12, 2025 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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