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

feat(ir): support pretty printing arbitrary traversable objects #9043

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

kszucs
Copy link
Member

@kszucs kszucs commented Apr 23, 2024

This enables pretty formatting the dereference mappings and also the replacements mappings we use in rewrites for better inspection. Also moved the irrelevant logic out from format.py.

@@ -259,3 +260,21 @@ class Coercible(Abstract):
@classmethod
@abstractmethod
def __coerce__(cls, value: Any, **kwargs: Any) -> Self: ...


def get_defining_frame(obj):
Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps not the typing module is the best place for this, but we don't have an inspect module here yet. We can reorganize later since these are designed for public use.

@cpcloud cpcloud added this to the 9.0 milestone Apr 25, 2024
@cpcloud cpcloud added feature Features or general enhancements internals Issues or PRs related to ibis's internal APIs labels Apr 25, 2024
@cpcloud cpcloud merged commit 68dfe39 into ibis-project:main Apr 25, 2024
86 checks passed
@cpcloud cpcloud deleted the more-generic-repr branch April 25, 2024 13:11
kszucs added a commit that referenced this pull request Apr 25, 2024
#8992)

Enables to use fields from parent tables of the join right hand side
instead of enforcing to use the same exact table:

```py
t1 = ibis.table(name="t1", schema={"a": "int64", "b": "string"})
t2 = ibis.table(name="t2", schema={"c": "int64", "d": "string"})

t3 = t2.mutate(e=t2.c + 1)
joined = t1.join(t3, [t1.a == t2.c])  # here we use t2.c instead of t3.c
```

Identify ambiguous cases and raise an error, like the following case:

```py
t.join(t, [t.a == t.a])
```

depends on:
- #9043 
- #9041 

fixes #8581
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features or general enhancements internals Issues or PRs related to ibis's internal APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants