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(ir): make Annotable immutable #3619

Merged
merged 1 commit into from
Mar 20, 2022

Conversation

kszucs
Copy link
Member

@kszucs kszucs commented Mar 17, 2022

Alternative implementation of #3609

Additions:

  • enforced immutable node arguments making the hashing easier
  • execute the rules before calling __init__() (using AnnotableMeta.__call__())
  • implicitly called __post_init__ setting the args tuple and _hash

@pep8speaks
Copy link

pep8speaks commented Mar 17, 2022

Hello @kszucs! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-03-20 11:29:59 UTC

@kszucs
Copy link
Member Author

kszucs commented Mar 17, 2022

@cpcloud still need to fix the remaining issues, just wanted to put up the PR for comparison.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2022

Unit Test Results

         6 files           6 suites   1m 26s ⏱️
  2 929 tests   2 883 ✔️   46 💤 0
17 574 runs  17 298 ✔️ 276 💤 0

Results for commit 9de0fd0.

♻️ This comment has been updated with latest results.

ibis/backends/base/sql/alchemy/__init__.py Outdated Show resolved Hide resolved
ibis/expr/operations/relations.py Show resolved Hide resolved
ibis/expr/operations/relations.py Show resolved Hide resolved
ibis/expr/operations/relations.py Show resolved Hide resolved
ibis/expr/signature.py Outdated Show resolved Hide resolved
ibis/expr/signature.py Outdated Show resolved Hide resolved
ibis/expr/types/core.py Outdated Show resolved Hide resolved
@cpcloud cpcloud added refactor Issues or PRs related to refactoring the codebase breaking change Changes that introduce an API break at any level expressions Issues or PRs related to the expression API labels Mar 18, 2022
@cpcloud cpcloud added this to the 3.0.0 milestone Mar 18, 2022
ibis/util.py Outdated Show resolved Hide resolved
Copy link
Member Author

@kszucs kszucs left a comment

Choose a reason for hiding this comment

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

Thanks @cpcloud for finishing it!

+1 from me.

@cpcloud
Copy link
Member

cpcloud commented Mar 19, 2022

@kszucs Is there any way we can avoid changing the execute_node interface to pass in tuples as arguments? If not, no worries.

@kszucs
Copy link
Member Author

kszucs commented Mar 19, 2022

Can't think of any clean solution.

Annotable instances are now truly immutable.

BREAKING CHANGE: Relation-based `execute_node` dispatch rules must now accept tuples of expressions.
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

seems fine

@cpcloud cpcloud merged commit 1f2b3fa into ibis-project:master Mar 20, 2022
gforsyth added a commit to gforsyth/ibis that referenced this pull request Mar 23, 2022
cpcloud pushed a commit that referenced this pull request Mar 23, 2022
Fix for minor regression introduced in #3619
@kszucs kszucs deleted the immutable-annotable branch May 30, 2022 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Changes that introduce an API break at any level expressions Issues or PRs related to the expression API refactor Issues or PRs related to refactoring the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants